• littledan's avatar
    Sloppy-mode let parsing · decc7b09
    littledan authored
    This patch makes 'let' a contextual keyword in both strict and sloppy mode.
    It behaves as a keyword when used at the beginning of a StatementListItem
    or lexical declaration at the beginning of a for statement, if it is followed
    by an identifier, [ or {. Implementing this change requires an extra token
    look-ahead by the parser which is only invoked in certain cases (so as to
    avoid parsing RegExps as ECMAScript tokens). This might result in a slowdown
    of the scanner, but performance testing of this patch hasn't yet found much
    of a regression.
    
    BUG=v8:3305
    LOG=Y
    R=adamk,vogelheim
    
    Review URL: https://codereview.chromium.org/1315673009
    
    Cr-Commit-Position: refs/heads/master@{#30451}
    decc7b09
token.h 14.5 KB