ECMAScript spec assertion fails when binding is deleted?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ECMAScript spec assertion fails when binding is deleted?

Jim Blandy-3
When executing this code:
(function () {
    eval("var x=delete(x)")
})()
I think the assertion in the ECMAScript description of the declarative environment record's SetMutableBinding algorithm, 10.2.1.1.3 step 2, fails.
  • On entry to the function, we create a lexical environment with a declarative environment record (10.4.3).
  • When we enter the eval code, we create the binding for 'x' in that environment record  (10.5, step 8.c.1). This is a deletable binding, as per 10.5 step 2.
  • When we evaluate the declaration, we produce a reference with that environment record as its base, delete the binding, and then call PutValue (12.2, VariableDeclaration : Identifier Initialiser semantics).
  • PutValue calls the environment record's SetMutableBinding concrete method (8.7.2 step 5.a).
  • SetMutableBinding's assertion fails, because 'x' is no longer bound in that environment record (10.2.1.1.3 step 2).
Have I missed something?

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: ECMAScript spec assertion fails when binding is deleted?

Jeff Walden-6
I think you've rediscovered the bug mentioned in the list thread titled "Assigning to eval-introduced local bindings outside strict mode, and an ES5 spec bug", spanning 20101124-20101126.  I don't know whether any followup happened to fix that or not in the spec, haven't been concerned enough to follow up and check.

Jeff
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: ECMAScript spec assertion fails when binding is deleted?

Jim Blandy-3
In reply to this post by Jim Blandy-3
This is a bug in the spec, and has been previously discussed here:

https://mail.mozilla.org/pipermail/es5-discuss/2010-November/003839.html

(Thanks, Jeff!)

On 03/20/2011 11:22 PM, Jim Blandy wrote:
When executing this code:
(function () {
    eval("var x=delete(x)")
})()
I think the assertion in the ECMAScript description of the declarative environment record's SetMutableBinding algorithm, 10.2.1.1.3 step 2, fails.
  • On entry to the function, we create a lexical environment with a declarative environment record (10.4.3).
  • When we enter the eval code, we create the binding for 'x' in that environment record  (10.5, step 8.c.1). This is a deletable binding, as per 10.5 step 2.
  • When we evaluate the declaration, we produce a reference with that environment record as its base, delete the binding, and then call PutValue (12.2, VariableDeclaration : Identifier Initialiser semantics).
  • PutValue calls the environment record's SetMutableBinding concrete method (8.7.2 step 5.a).
  • SetMutableBinding's assertion fails, because 'x' is no longer bound in that environment record (10.2.1.1.3 step 2).
Have I missed something?
_______________________________________________ es-discuss mailing list [hidden email] https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: ECMAScript spec assertion fails when binding is deleted?

Allen Wirfs-Brock
This is now https://bugs.ecmascript.org/show_bug.cgi?id=79 


On Mar 21, 2011, at 11:44 AM, Jim Blandy wrote:

This is a bug in the spec, and has been previously discussed here:

https://mail.mozilla.org/pipermail/es5-discuss/2010-November/003839.html

(Thanks, Jeff!)

On 03/20/2011 11:22 PM, Jim Blandy wrote:
When executing this code:
(function () {
    eval("var x=delete(x)")
})()
I think the assertion in the ECMAScript description of the declarative environment record's SetMutableBinding algorithm, 10.2.1.1.3 step 2, fails.
  • On entry to the function, we create a lexical environment with a declarative environment record (10.4.3).
  • When we enter the eval code, we create the binding for 'x' in that environment record  (10.5, step 8.c.1). This is a deletable binding, as per 10.5 step 2.
  • When we evaluate the declaration, we produce a reference with that environment record as its base, delete the binding, and then call PutValue (12.2, VariableDeclaration : Identifier Initialiser semantics).
  • PutValue calls the environment record's SetMutableBinding concrete method (8.7.2 step 5.a).
  • SetMutableBinding's assertion fails, because 'x' is no longer bound in that environment record (10.2.1.1.3 step 2).
Have I missed something?
_______________________________________________ es-discuss mailing list [hidden email] https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss