Skip to content

SetMutableBinding and ImportBindings #2639

Open
@jmdyck

Description

@jmdyck

This concerns:

  • immutable indirect bindings (IIB) created by CreateImportBinding for module Environment Records, and
  • the SetMutableBinding method for declarative Environment Records (which includes module Environment Records).

Currently, SetMutableBinding doesn't explicitly say how it handles an IIB. Mostly, it doesn't need to be explicit:

  • an IIB is initialized when created, so the 'has not yet been initialized' step doesn't apply, and
  • an IIB is immutable, so the 'is a mutable binding' step doesn't apply.

So it's clear that SetMutableBinding won't change the IIB, the only question is whether to throw a *TypeError* or not. Which depends on:

  • whether an IIB is a strict binding, or
  • whether the passed-in _S_ is *true*.

Now it definitely isn't stated that an IIB is a strict binding, but it might be intended. And I think the passed-in _S_ is always *true* for any case involving an IIB (i.e., for a module Environment Record), but I'm not completely sure.

So: does SetMutableBinding always throw a *TypeError* when the binding in question is an IIB?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions