[parser] disallow language mode directive in body of function with non-simple parameters
authorconradw <conradw@chromium.org>
Wed, 26 Aug 2015 14:59:05 +0000 (07:59 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 26 Aug 2015 14:59:19 +0000 (14:59 +0000)
commit77394fa05a63a539ac4e6858d99cc85ec6867512
treead45444d18fc8ba32860f0e202c5e7279b7bafe9
parentaca4a411e7082ffc790d79261ff383043de756ad
[parser] disallow language mode directive in body of function with non-simple parameters

TC39 agreed to disallow "use strict" directives in function body when
non-simple parameter lists are used.

This is a continuation of caitp's CL https://codereview.chromium.org/1281163002/
with some refactorings removed for now.

Still TODO: there is a lot of duplication between the is_simple field of
FormalParametersBase and the NonSimpleParameter property ExpressionClassifier
keeps track of. It should be possible to remove the former with a minor
refactoring of arrow function parsing. This will be attempted in a follow-up CL.

BUG=
LOG=N

Review URL: https://codereview.chromium.org/1300103005

Cr-Commit-Position: refs/heads/master@{#30388}
17 files changed:
src/expression-classifier.h
src/messages.h
src/parser.cc
src/parser.h
src/preparser.cc
src/preparser.h
src/scopes.cc
src/scopes.h
test/cctest/test-parsing.cc
test/mjsunit/harmony/arrow-rest-params.js
test/mjsunit/harmony/default-parameters.js
test/mjsunit/harmony/destructuring.js
test/mjsunit/harmony/rest-params.js
test/mjsunit/harmony/spread-call-super-property.js
test/mjsunit/strong/destructuring.js
test/mjsunit/strong/function-arity.js
test/mjsunit/strong/literals.js