Bug 171048 - Should not be able to use a keyword in object literal shorthand syntax
Summary: Should not be able to use a keyword in object literal shorthand syntax
Status: RESOLVED DUPLICATE of bug 170979
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-20 01:35 PDT by Joseph Pecoraro
Modified: 2017-04-21 11:34 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2017-04-20 01:35:22 PDT
Summary:
Should not be able to use a keyword in object literal shorthand syntax

Test:
js> var o = {class};

Expected:
SyntaxError - cannot use a reserved word here

Actual:
ReferenceError - no variable named class

Notes:
• Chrome: Uncaught SyntaxError: Unexpected token }
• Firefox: SyntaxError: keyword 'class' is a reserved identifier
Comment 1 Joseph Pecoraro 2017-04-21 11:34:55 PDT
I have a fix for this, but I'm going to include the fix in:
https://bugs.webkit.org/show_bug.cgi?id=170979

*** This bug has been marked as a duplicate of bug 170979 ***