Ignore:
Timestamp:
Jun 16, 2011, 8:17:11 PM (14 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=53014
ES5 strict mode keyword restrictions aren't implemented

Reviewed by Oliver Hunt.

The following are future restricted words is strict mode code:

implements, interface, let, package, private, protected, public, static, yield

Source/JavaScriptCore:

  • parser/JSParser.h:
    • Add RESERVED_IF_STRICT token.
  • parser/Keywords.table:
    • Add new future restricted words.
  • parser/Lexer.cpp:

(JSC::Lexer::parseIdentifier):

  • Check for RESERVED_IF_STRICT; in nonstrict code this is converted to IDENT.

(JSC::Lexer::lex):

  • Pass strictMode flag to parseIdentifier.
  • parser/Lexer.h:
    • parseIdentifier needs a strictMode flag.
  • runtime/CommonIdentifiers.h:
    • Add identifiers for new reserved words.

LayoutTests:

  • fast/js/keywords-and-reserved_words-expected.txt: Added.
  • fast/js/keywords-and-reserved_words.html: Added.
  • fast/js/script-tests/keywords-and-reserved_words.js: Added.

(isKeyword):
(isStrictKeyword):
(classifyIdentifier):

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.