Reviewers: adamk,

Message:
This is currently more of an RFC because of the indeterminate performance
impact. It should not be merged before the 46 branch.

Description:
Sloppy-mode let parsing

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). Unfortunately, this results
in a slowdown of the scanner (not yet measured, but a similar experiment showed
~3% on Octane CodeLoad).

BUG=v8:3305
LOG=Y
R=adamk

Please review this at https://codereview.chromium.org/1295883002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+106, -21 lines):
  M src/parser.cc
  M src/preparser.h
  M src/preparser.cc
  M src/scanner.h
  M src/scanner.cc
  M src/token.h
  M test/cctest/test-parsing.cc


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to