-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing to deleted global variable references has been classified as a spec bug #427
Comments
I need to investigate these cases, currently assigning this to myself. |
This definitely needs follow up. I shouldn't hold this one for too long. |
I'm having trouble with this piece of code: Object.defineProperty(this, "x", {
configurable: true,
get: function() {
delete this.x;
return 2;
}
});
(function() {
"use strict";
++x;
})(); Here comes the evaluation:
IIUC, the base value of The delete happens in the back to PutValue
So we reach the SetMutableBinding for global Env Records. (8.1.1.4.5)
Now the DeclarativeRecord wont have a binding X. So we would roll to
This would give me no path to get a ReferenceError for the Although, the engines seem to not agree with anything:
I'm not sure where is ReferenceError... let me try this again... |
I wonder if the The engine results throwing a RefError make me think this is the case. In my brain, the base value component is not changed within the current spec text. Somehow it persists when we fetched that Reference (before the delete). cc @tc39/ecma262-editors. |
@leobalter I believe your reading of the spec is correct: that is, in the current spec, there is no reference error. Per that esdiscuss thread, this is a bug in the specification. I (apparently) opened a bugzilla issue to track this, and it never got fixed. But engines still don't pass the tests (e.g. v8 xfails them) and we should fix it upstream. Opened tc39/ecma262#2093 to track. |
I have a tentative PR Draft in tc39/ecma262#2094 but I need to follow up investigating usage of PutValue to confirm it works. |
…tc39#2094) Verify binding existence in the object's SetMutableBinding on Strict Mode. Closes tc39#2093 Ref tc39#467 Ref tc39/test262#427
More invalid tests: language/expressions/compound-assignment/S11.13.2_A5.1_T4.js |
…ow a ReferenceError exception in strict mode code. Fixes gh-427
…ow a ReferenceError exception in strict mode code. Fixes gh-427
…ow a ReferenceError exception in strict mode code. Fixes gh-427
…ow a ReferenceError exception in strict mode code. Fixes gh-427
See this es-discuss thread.
This invalidates at least the following tests:
test/language/expressions/prefix-increment/S11.4.4_A5_T5.js
test/language/expressions/postfix-increment/S11.3.1_A5_T5.js
test/language/expressions/prefix-decrement/S11.4.5_A5_T5.js
test/language/expressions/postfix-decrement/S11.3.2_A5_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.1_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.2_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.3_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.4_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.5_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.6_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.7_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.8_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.9_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.10_T5.js
test/language/expressions/compound-assignment/S11.13.2_A5.11_T5.js
test/language/expressions/assignment/S11.13.1_A5_T5.js
The text was updated successfully, but these errors were encountered: