Implement ES2016 check for simple parameter list in strict mode (#106)
* Slightly simplify logic * Implement ES2016 check for simple parameter list in strict mode See e.g. ECMA-262 7.0 14.1.2: > It is a Syntax Error if ContainsUseStrict of FunctionBody is true and > IsSimpleParameterList of FormalParameters is false. Similar clauses cover arrow functions, generator functions, methods, and generator methods, as well as async functions and async arrow functions.
This commit is contained in:
committed by
Daniel Tschinder
parent
64145b07e3
commit
643d3f37a4
3
test/fixtures/es2016/simple-parameter-list/generator-function/actual.js
vendored
Normal file
3
test/fixtures/es2016/simple-parameter-list/generator-function/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
function* a(options = {}) {
|
||||
"use strict";
|
||||
}
|
||||
3
test/fixtures/es2016/simple-parameter-list/generator-function/options.json
vendored
Normal file
3
test/fixtures/es2016/simple-parameter-list/generator-function/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Non-simple parameter in strict mode (1:12)"
|
||||
}
|
||||
Reference in New Issue
Block a user