-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix #2949: Class const name binding incorrectly marked as module export storage #4662
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
Conversation
0b3c5a8 to
f3179db
Compare
boingoing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix and good test coverage
| assert.areEqual(true, A2Inst.bindingModified(), 'Captured class name observes mutation'); | ||
| assert.throws(function () { A2Inst.attemptBindingChange(); }, TypeError, 'Delay exported class name captured in class is still const', "Assignment to const"); | ||
|
|
||
| export let B1 = class B1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like one more set of these if you don't mind where the let binding name is different from the class expression name. export let C1 = class NotC1 { for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also fixed my conditional language which was inverted :)
…module export storage We were mistakenly marking both the class let and const decls as module export storage. This resulted in empty instantiated scopes and incorrect class behavior in some cases. The fix is not to mark the const binding as module export storage, as it is visible to the inside of the class only. Added some tests to verify the bindings of exported classes.
|
Should there be a test of what is/is not observable from the site where the module is loaded? |
dilijev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pleath
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, gee, that was easy. :)
…marked as module export storage Merge pull request #4662 from tcare:classexport We were mistakenly marking both the class let and const decls as module export storage. This resulted in empty instantiated scopes and incorrect class behavior in some cases. The fix is not to mark the const binding as module export storage, as it is visible to the inside of the class only. Added some tests to verify the bindings of exported classes.
…correctly marked as module export storage Merge pull request #4662 from tcare:classexport We were mistakenly marking both the class let and const decls as module export storage. This resulted in empty instantiated scopes and incorrect class behavior in some cases. The fix is not to mark the const binding as module export storage, as it is visible to the inside of the class only. Added some tests to verify the bindings of exported classes.
…me binding incorrectly marked as module export storage Merge pull request #4662 from tcare:classexport We were mistakenly marking both the class let and const decls as module export storage. This resulted in empty instantiated scopes and incorrect class behavior in some cases. The fix is not to mark the const binding as module export storage, as it is visible to the inside of the class only. Added some tests to verify the bindings of exported classes.
We were mistakenly marking both the class let and const decls as module export storage. This resulted in empty instantiated scopes and incorrect class behavior in some cases.
The fix is not to mark the const binding as module export storage, as it is visible to the inside of the class only.
Added some tests to verify the bindings of exported classes.