archives

« Bugzilla Issues Index

#4047 — 8.1.1.5.1 GetBindingValue: Wrong test in step 3.b


8.1.1.5.1 GetBindingValue(N,S)

Steps 3.b-c should read:
> Let targetEnv be M.[[Environment]].
> If targetEnv is undefined, throw a ReferenceError exception.
> Let targetER be targetEnv’s environment record.


fixed in rev35 editor's draft

I'm pretty sure (but not certain) that this condition never occurs. I considered an assert, but the uncertainty makes the throw a better choice.


(In reply to Allen Wirfs-Brock from comment #1)
> I'm pretty sure (but not certain) that this condition never occurs. I
> considered an assert, but the uncertainty makes the throw a better choice.

It shouldn't be possible with the built-in Source Text Module Record, but a Module Record implementation from a different specification may have other semantics. So I agree with saying that `throw` is the better choice.


fixed in rev35