You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
I don't think there's anything preventing us from saying it's strict, so that seems the preferable option. In which case, a TypeError should be thrown.
This should be testable, right? Can we see what implementations do here?
This should be testable, right? Can we see what implementations do here?
If the passed-in _S_ is *true*, a TypeError should be thrown regardless of the strictness of an IIB. So the most interesting test would cause the passed-in _S_ to be *false*, because then the results would reveal whether implementations treat an IIB as a strict binding. However, I don't know if it's possible to construct such a test.
This concerns:
Currently, SetMutableBinding doesn't explicitly say how it handles an IIB. Mostly, it doesn't need to be explicit:
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:_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?The text was updated successfully, but these errors were encountered: