-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fixes #5576 - Chakra should not redeclare "undefined" keyword #5734
Conversation
4ad22f4
to
5558c3d
Compare
5558c3d
to
3a65aa7
Compare
lib/Parser/perrors.h
Outdated
LSC_ERROR_MSG( 1015, ERRnoStrEnd , "Unterminated string constant") | ||
LSC_ERROR_MSG( 1016, ERRnoCmtEnd , "Unterminated comment") | ||
LSC_ERROR_MSG( 1017, ERRIdAfterLit , "Unexpected identifier after numeric literal") | ||
LSC_ERROR_MSG(1004, ERRnoSemic, "Expected ';'") |
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.
nit: Can you revert the formatting changes that were made to this file?
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 except maybe tweaking that error message.
lib/Runtime/Types/RecyclableObject.h
Outdated
@@ -313,6 +313,7 @@ namespace Js { | |||
virtual BOOL InitPropertyInEval(PropertyId propertyId, Var value, PropertyOperationFlags flags = PropertyOperation_None, PropertyValueInfo* info = NULL); | |||
virtual BOOL EnsureProperty(PropertyId propertyId); | |||
virtual BOOL EnsureNoRedeclProperty(PropertyId propertyId); | |||
virtual BOOL EnsureNoRedeclFunc(PropertyId propertyId); |
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 see that you're following the pattern of EnsureNoRedeclProperty, but I don't think the pattern should necessarily apply, because EnsureNoRedeclProperty is used in a much bigger variety of ways.
- Why does this have a return value? As far as I can tell, the returned value is never used.
- Why is this virtual and defined on RecyclableObject? The only call site knows that the type will be RootObjectBase; can't we just cast directly to that and call a non-virtual method?
bb944f9
to
66e1d2d
Compare
…ord. Fixed by adding opcode OP_EnsureNoRootRedeclFunc that enforces the section of #sec-globaldeclarationinstantiation where #CanDeclareGlobalFunction is called. This enforces that when a global function that is not configurable, not writable, and not enumerable is overwritten a TypeError is thrown.
66e1d2d
to
8ecdb9e
Compare
…defined" keyword Merge pull request #5734 from wyrichte:build/wyrichte/5576_1 Fixed by adding opcode OP_EnsureNoRootRedeclFunc that enforces the section of #sec-globaldeclarationinstantiation where #CanDeclareGlobalFunction is called. This enforces that when a global function that is not configurable, not writable, and not enumerable is overwritten a TypeError is thrown.
Fixed by adding opcode OP_EnsureNoRootRedeclFunc that enforces the section of #sec-globaldeclarationinstantiation where #CanDeclareGlobalFunction is called. This enforces that when a global function that is not configurable, not writable, and not enumerable is overwritten a TypeError is thrown.