Changeset 209350 in webkit


Ignore:
Timestamp:
Dec 5, 2016 2:20:08 PM (7 years ago)
Author:
caitp@igalia.com
Message:

[JSC] report unexpected token when "async" is followed by identifier
https://bugs.webkit.org/show_bug.cgi?id=165091

Reviewed by Mark Lam.

JSTests:

  • stress/bug-165091.js:

Source/JavaScriptCore:

Report a SyntaxError, in order to report correct error in contexts
an async ArrowFunction cannot occur. Also corrects errors in comment
describing JSTokenType bitfield, which was added in r209293.

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseMemberExpression):

  • parser/ParserTokens.h:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r209328 r209350  
     12016-12-05  Caitlin Potter  <caitp@igalia.com>
     2
     3        [JSC] report unexpected token when "async" is followed by identifier
     4        https://bugs.webkit.org/show_bug.cgi?id=165091
     5
     6        Reviewed by Mark Lam.
     7
     8        * stress/bug-165091.js:
     9
    1102016-12-05  Keith Miller  <keith_miller@apple.com>
    211
  • trunk/JSTests/stress/bug-165091.js

    r209293 r209350  
    1111}
    1212
    13 shouldThrowSyntaxError("0/-async J", "SyntaxError: Cannot parse member expression.")
     13shouldThrowSyntaxError("0/-async J", "Unexpected identifier 'J'")
     14
  • trunk/Source/JavaScriptCore/ChangeLog

    r209328 r209350  
     12016-12-05  Caitlin Potter  <caitp@igalia.com>
     2
     3        [JSC] report unexpected token when "async" is followed by identifier
     4        https://bugs.webkit.org/show_bug.cgi?id=165091
     5
     6        Reviewed by Mark Lam.
     7
     8        Report a SyntaxError, in order to report correct error in contexts
     9        an async ArrowFunction cannot occur. Also corrects errors in comment
     10        describing JSTokenType bitfield, which was added in r209293.
     11
     12        * parser/Parser.cpp:
     13        (JSC::Parser<LexerType>::parseMemberExpression):
     14        * parser/ParserTokens.h:
     15
    1162016-12-05  Keith Miller  <keith_miller@apple.com>
    217
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r208933 r209350  
    44774477                // AsyncArrowFunction
    44784478                forceClassifyExpressionError(ErrorIndicatesAsyncArrowFunction);
    4479                 return 0;
     4479                failDueToUnexpectedToken();
    44804480            }
    44814481            baseIsAsyncKeyword = true;
  • trunk/Source/JavaScriptCore/parser/ParserTokens.h

    r209293 r209350  
    3535
    3636enum {
    37     // Token Bitfield: 0b000000000RTEIIIIIIIIPPPPKUXXXXXX
     37    // Token Bitfield: 0b000000000RTE000IIIIPPPPKUXXXXXXX
    3838    // R = right-associative bit
    3939    // T = unterminated error flag
Note: See TracChangeset for help on using the changeset viewer.