arguments-with-arguments-fn.js |
---
esid: sec-functiondeclarationinstantiation
es6id: 9.2.12
description: >
Arguments object is created even when the body contains a lexically-scoped
binding named "arguments"
info: |
[...]
19. Else if "arguments" is an element of parameterNames, then
a. Let argumentsObjectNeeded be false.
20. Else if hasParameterExpressions is false, then
a. If "arguments" is an element of functionNames or if "arguments" is an
element of lexicalNames, then
i. Let argumentsObjectNeeded be false.
[...]
flags: [noStrict]
--- |
883 |
arguments-with-arguments-lex.js |
---
esid: sec-functiondeclarationinstantiation
es6id: 9.2.12
description: >
Arguments object is created even when the body contains a function named
"arguments"
info: |
[...]
19. Else if "arguments" is an element of parameterNames, then
a. Let argumentsObjectNeeded be false.
20. Else if hasParameterExpressions is false, then
a. If "arguments" is an element of functionNames or if "arguments" is an
element of lexicalNames, then
i. Let argumentsObjectNeeded be false.
[...]
flags: [noStrict]
--- |
859 |
array-destructuring-param-strict-body.js |
|
5247 |
browser.js |
|
0 |
dflt-params-abrupt.js |
---
description: Abrupt completion returned by evaluation of initializer (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.19 Runtime Semantics: IteratorBindingInitialization
FormalsList : FormalsList , FormalParameter
1. Let status be the result of performing IteratorBindingInitialization for
FormalsList using iteratorRecord and environment as the arguments.
2. ReturnIfAbrupt(status).
3. Return the result of performing IteratorBindingInitialization for
FormalParameter using iteratorRecord and environment as the arguments.
--- |
1982 |
dflt-params-arg-val-not-undefined.js |
---
description: Use of initializer when argument value is not `undefined` (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.19 Runtime Semantics: IteratorBindingInitialization
FormalsList : FormalsList , FormalParameter
[...]
23. Let iteratorRecord be Record {[[Iterator]]:
CreateListIterator(argumentsList), [[Done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
a. Perform ? IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
--- |
2831 |
dflt-params-arg-val-undefined.js |
---
description: Use of initializer when argument value is `undefined` (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.19 Runtime Semantics: IteratorBindingInitialization
FormalsList : FormalsList , FormalParameter
[...]
23. Let iteratorRecord be Record {[[Iterator]]:
CreateListIterator(argumentsList), [[Done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
a. Perform ? IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
--- |
2100 |
dflt-params-duplicates.js |
---
description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.2 Static Semantics: Early Errors
StrictFormalParameters : FormalParameters
- It is a Syntax Error if BoundNames of FormalParameters contains any
duplicate elements.
FormalParameters : FormalParameterList
- It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
false and BoundNames of FormalParameterList contains any duplicate
elements.
--- |
1834 |
dflt-params-ref-later.js |
---
description: Referencing a parameter that occurs later in the ParameterList (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.19 Runtime Semantics: IteratorBindingInitialization
FormalsList : FormalsList , FormalParameter
1. Let status be the result of performing IteratorBindingInitialization for
FormalsList using iteratorRecord and environment as the arguments.
2. ReturnIfAbrupt(status).
3. Return the result of performing IteratorBindingInitialization for
FormalParameter using iteratorRecord and environment as the arguments.
--- |
1965 |
dflt-params-ref-prior.js |
---
description: Referencing a parameter that occurs earlier in the ParameterList (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.19 Runtime Semantics: IteratorBindingInitialization
FormalsList : FormalsList , FormalParameter
1. Let status be the result of performing IteratorBindingInitialization for
FormalsList using iteratorRecord and environment as the arguments.
2. ReturnIfAbrupt(status).
3. Return the result of performing IteratorBindingInitialization for
FormalParameter using iteratorRecord and environment as the arguments.
--- |
2133 |
dflt-params-ref-self.js |
---
description: Referencing a parameter from within its own initializer (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.19 Runtime Semantics: IteratorBindingInitialization
FormalsList : FormalsList , FormalParameter
1. Let status be the result of performing IteratorBindingInitialization for
FormalsList using iteratorRecord and environment as the arguments.
2. ReturnIfAbrupt(status).
3. Return the result of performing IteratorBindingInitialization for
FormalParameter using iteratorRecord and environment as the arguments.
--- |
1954 |
dflt-params-rest.js |
---
description: RestParameter does not support an initializer (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1 Function Definitions
Syntax
FunctionRestParameter[Yield] :
BindingRestElement[?Yield]
13.3.3 Destructuring Binding Patterns
Syntax
BindingRestElement[Yield] :
...BindingIdentifier[?Yield]
...BindingPattern[?Yield]
--- |
1653 |
dflt-params-trailing-comma.js |
---
description: A trailing comma should not increase the respective length, using default parameters (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
--- |
1790 |
dstr |
|
|
early-body-super-call.js |
---
esid: sec-function-definitions-static-semantics-early-errors
es6id: 14.1.2
description: Body may not contain a "super" call
info: |
It is a Syntax Error if FunctionBody Contains SuperCall is true.
negative:
phase: parse
type: SyntaxError
--- |
475 |
early-body-super-prop.js |
---
esid: sec-function-definitions-static-semantics-early-errors
es6id: 14.1.2
description: Body may not contain a "super" property reference
info: |
It is a Syntax Error if FunctionBody Contains SuperProperty is true.
negative:
phase: parse
type: SyntaxError
--- |
493 |
early-errors |
|
|
early-params-super-call.js |
---
esid: sec-function-definitions-static-semantics-early-errors
es6id: 14.1.2
description: Parameters may not contain a "super" call
info: |
It is a Syntax Error if FormalParameters Contains SuperProperty is true.
negative:
phase: parse
type: SyntaxError
--- |
488 |
early-params-super-prop.js |
---
esid: sec-function-definitions-static-semantics-early-errors
es6id: 14.1.2
description: Parameters may not contain a "super" property reference
info: |
It is a Syntax Error if FunctionBody Contains SuperProperty is true.
negative:
phase: parse
type: SyntaxError
--- |
498 |
eval-var-scope-syntax-err.js |
---
description: sloppy direct eval in params introduces var (function expression in sloppy code)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [default-parameters]
flags: [generated, noStrict]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
Runtime Semantics: IteratorBindingInitialization
FormalParameter : BindingElement
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
--- |
1769 |
forbidden-ext |
|
|
length-dflt.js |
---
es6id: 14.1.6
description: >
Default parameters' effect on function length
info: |
Function length is counted by the non initialized parameters in the left.
9.2.4 FunctionInitialize (F, kind, ParameterList, Body, Scope)
[...]
2. Let len be the ExpectedArgumentCount of ParameterList.
3. Perform ! DefinePropertyOrThrow(F, "length", PropertyDescriptor{[[Value]]:
len, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).
[...]
FormalsList : FormalParameter
1. If HasInitializer of FormalParameter is true return 0
2. Return 1.
FormalsList : FormalsList , FormalParameter
1. Let count be the ExpectedArgumentCount of FormalsList.
2. If HasInitializer of FormalsList is true or HasInitializer of
FormalParameter is true, return count.
3. Return count+1.
features: [default-parameters]
includes: [propertyHelper.js]
--- |
1635 |
name-arguments-non-strict.js |
---
es5id: 13.1-3-8
description: >
arguments allowed as function identifier in non-strict function
expression
flags: [noStrict]
--- |
330 |
name-arguments-strict-body.js |
---
es5id: 13.1-42-s
description: >
StrictMode - SyntaxError is thrown if 'arguments' occurs as the
Identifier of a FunctionExpression whose FunctionBody is contained
in strict code
negative:
phase: parse
type: SyntaxError
flags: [noStrict]
--- |
492 |
name-arguments-strict-strict.js |
---
es5id: 13.1-14-s
description: >
StrictMode - SyntaxError is thrown if 'arguments' occurs as the
Identifier of a FunctionExpression in strict mode
negative:
phase: parse
type: SyntaxError
flags: [onlyStrict]
--- |
459 |
name-eval-non-strict.js |
---
es5id: 13.1-3-2
description: >
eval allowed as function identifier in non-strict function
expression
flags: [noStrict]
--- |
319 |
name-eval-strict-body.js |
---
es5id: 13.1-38-s
description: >
StrictMode - SyntaxError is thrown if 'eval' occurs as the
Identifier of a FunctionExpression whose FunctionBody is contained
in strict code
negative:
phase: parse
type: SyntaxError
flags: [noStrict]
--- |
482 |
name-eval-strict-strict.js |
---
es5id: 13.1-12-s
description: >
StrictMode - SyntaxError is thrown if 'eval' occurs as the
Identifier of a FunctionExpression in strict mode
negative:
phase: parse
type: SyntaxError
flags: [onlyStrict]
--- |
449 |
name-eval-stricteval.js |
---
es5id: 13.1-37-s
description: >
StrictMode - SyntaxError is thrown if 'eval' occurs as the
Identifier of a FunctionExpression in strict eval code
flags: [noStrict]
--- |
486 |
name.js |
---
esid: sec-function-definitions-runtime-semantics-evaluation
description: Assignment of function `name` attribute
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
1. Let scope be the LexicalEnvironment of the running execution context.
2. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, "").
...
5. Return closure.
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
1. Let scope be the running execution context's LexicalEnvironment.
2. Let funcEnv be NewDeclarativeEnvironment(scope).
3. Let envRec be funcEnv's EnvironmentRecord.
4. Let name be StringValue of BindingIdentifier.
5. Perform envRec.CreateImmutableBinding(name, false).
6. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
funcEnv, name).
...
10. Return closure.
includes: [propertyHelper.js]
--- |
1350 |
named-no-strict-reassign-fn-name-in-body-in-arrow.js |
---
description: Reassignment of function name is silently ignored in non-strict mode code. (named function expression in non-strict mode code)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated, noStrict]
info: |
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
--- |
850 |
named-no-strict-reassign-fn-name-in-body-in-eval.js |
---
description: Reassignment of function name is silently ignored in non-strict mode code. (named function expression in non-strict mode code)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated, noStrict]
info: |
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
--- |
836 |
named-no-strict-reassign-fn-name-in-body.js |
---
description: Reassignment of function name is silently ignored in non-strict mode code. (named function expression in non-strict mode code)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated, noStrict]
info: |
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
--- |
820 |
named-strict-error-reassign-fn-name-in-body-in-arrow-strict.js |
---
description: Reassignment of function name is silently ignored in non-strict mode code. (named function expression in strict mode code)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated, onlyStrict]
info: |
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
--- |
881 |
named-strict-error-reassign-fn-name-in-body-in-eval-strict.js |
---
description: Reassignment of function name is silently ignored in non-strict mode code. (named function expression in strict mode code)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated, onlyStrict]
info: |
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
--- |
867 |
named-strict-error-reassign-fn-name-in-body-strict.js |
---
description: Reassignment of function name is silently ignored in non-strict mode code. (named function expression in strict mode code)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated, onlyStrict]
info: |
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
--- |
851 |
object-destructuring-param-strict-body.js |
|
5250 |
param-arguments-non-strict.js |
---
es5id: 13.1-2-6
description: >
arguments allowed as formal parameter name of a non-strict
function expression
flags: [noStrict]
--- |
336 |
param-dflt-yield-non-strict.js |
---
esid: sec-function-definitions
es6id: 14.1
description: >
The `yield` token is interpreted as an IdentifierReference within a generator
and outside of strict mode
info: |
FunctionExpression :
function BindingIdentifieropt ( FormalParameters ) { FunctionBody }
features: [generators, default-parameters]
flags: [noStrict]
--- |
656 |
param-dflt-yield-strict-strict.js |
---
esid: sec-function-definitions
es6id: 14.1
description: >
The `yield` token is interpreted as an IdentifierReference within a generator
and outside of strict mode
info: |
FunctionExpression :
function BindingIdentifieropt ( FormalParameters ) { FunctionBody }
features: [generators, default-parameters]
flags: [onlyStrict]
negative:
phase: parse
type: SyntaxError
--- |
663 |
param-duplicated-non-strict.js |
---
es5id: 13.1-1-2
description: >
Duplicate identifier allowed in non-strict function expression
parameter list
flags: [noStrict]
--- |
329 |
param-duplicated-strict-1-strict.js |
---
info: |
Refer 13.1;
It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode
FunctionDeclaration or FunctionExpression.
es5id: 13.1-8-s
description: >
Strict Mode - SyntaxError is thrown if a function is created in
'strict mode' using a FunctionExpression and the function has two
identical parameters
negative:
phase: parse
type: SyntaxError
flags: [onlyStrict]
--- |
690 |
param-duplicated-strict-2-strict.js |
---
info: |
Refer 13.1;
It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode
FunctionDeclaration or FunctionExpression.
es5id: 13.1-9-s
description: >
Strict Mode - SyntaxError is thrown if a function is created in
'strict mode' using a FunctionExpression and the function has two
identical parameters, which are separated by a unique parameter
name
negative:
phase: parse
type: SyntaxError
flags: [onlyStrict]
--- |
752 |
param-duplicated-strict-3-strict.js |
---
info: |
Refer 13.1;
It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode
FunctionDeclaration or FunctionExpression.
es5id: 13.1-10-s
description: >
Strict Mode - SyntaxError is thrown if a function is created in
'strict mode' using a FunctionExpression and the function has
three identical parameters
negative:
phase: parse
type: SyntaxError
flags: [onlyStrict]
--- |
700 |
param-duplicated-strict-body-1.js |
---
info: |
Refer 13.1;
It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode
FunctionDeclaration or FunctionExpression.
es5id: 13.1-30-s
description: >
Strict Mode - SyntaxError is thrown if a function is created using
a FunctionExpression whose FunctionBody is contained in strict
code and the function has two identical parameters
negative:
phase: parse
type: SyntaxError
flags: [noStrict]
--- |
719 |
param-duplicated-strict-body-2.js |
---
info: |
Refer 13.1;
It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode
FunctionDeclaration or FunctionExpression.
es5id: 13.1-32-s
description: >
Strict Mode - SyntaxError is thrown if a function is created using
a FunctionExpression whose FunctionBody is strict and the function
has two identical parameters, which are separated by a unique
parameter name
negative:
phase: parse
type: SyntaxError
flags: [noStrict]
--- |
763 |
param-duplicated-strict-body-3.js |
---
info: |
Refer 13.1;
It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode
FunctionDeclaration or FunctionExpression.
es5id: 13.1-34-s
description: >
Strict Mode - SyntaxError is thrown if a function declaration has
three identical parameters with a strict mode body
negative:
phase: parse
type: SyntaxError
flags: [noStrict]
--- |
658 |
param-eval-non-strict-is-correct-value.js |
---
esid: sec-strict-mode-of-ecmascript
description: >
eval allowed as formal parameter name of a non-strict function expression
flags: [noStrict]
--- |
499 |
param-eval-non-strict.js |
---
es5id: 13.1-2-2
description: >
eval allowed as formal parameter name of a non-strict function
expression
flags: [noStrict]
--- |
326 |
param-eval-strict-body.js |
---
info: |
Refer 13.1;
It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList
of a strict mode FunctionDeclaration or FunctionExpression.
es5id: 13.1-18-s
description: >
StrictMode - SyntaxError is thrown if the identifier 'eval'
appears within a FormalParameterList of a strict mode
FunctionExpression when FuctionBody is strict code
negative:
phase: parse
type: SyntaxError
flags: [noStrict]
--- |
711 |
param-eval-stricteval.js |
---
info: |
Refer 13.1;
It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList
of a strict mode FunctionDeclaration or FunctionExpression.
es5id: 13.1-17-s
description: >
StrictMode - SyntaxError is thrown if the identifier 'eval'
appears within a FormalParameterList of a strict mode
FunctionExpression in strict eval code
flags: [noStrict]
--- |
709 |
params-dflt-args-unmapped.js |
---
description: Referencing the arguments object from a default parameter (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
es6id: 14.1.20
features: [default-parameters]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.19 Runtime Semantics: IteratorBindingInitialization
FormalsList : FormalsList , FormalParameter
1. Let status be the result of performing IteratorBindingInitialization for
FormalsList using iteratorRecord and environment as the arguments.
2. ReturnIfAbrupt(status).
3. Return the result of performing IteratorBindingInitialization for
FormalParameter using iteratorRecord and environment as the arguments.
--- |
2485 |
params-dflt-ref-arguments.js |
---
description: Referencing the arguments object from a default parameter (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
es6id: 14.1.20
features: [default-parameters]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
14.1.19 Runtime Semantics: IteratorBindingInitialization
FormalsList : FormalsList , FormalParameter
1. Let status be the result of performing IteratorBindingInitialization for
FormalsList using iteratorRecord and environment as the arguments.
2. ReturnIfAbrupt(status).
3. Return the result of performing IteratorBindingInitialization for
FormalParameter using iteratorRecord and environment as the arguments.
--- |
2088 |
params-trailing-comma-multiple.js |
---
description: A trailing comma should not increase the respective length, using multiple parameters (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
--- |
1783 |
params-trailing-comma-single.js |
---
description: A trailing comma should not increase the respective length, using a single parameter (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
--- |
1747 |
rest-param-strict-body.js |
|
5256 |
rest-params-trailing-comma-early-error.js |
---
description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
Trailing comma in the parameters list
14.1 Function Definitions
FormalParameters[Yield, Await] :
[empty]
FunctionRestParameter[?Yield, ?Await]
FormalParameterList[?Yield, ?Await]
FormalParameterList[?Yield, ?Await] ,
FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
--- |
1751 |
S10.1.1_A1_T2.js |
---
info: |
Program functions are defined in source text by a FunctionDeclaration or created dynamically either
by using a FunctionExpression or by using the built-in Function object as a constructor
es5id: 10.1.1_A1_T2
description: Creating function dynamically by using a FunctionExpression
--- |
983 |
scope-body-lex-distinct.js |
---
esid: sec-functiondeclarationinstantiation
description: >
Creation of new lexical environment (distinct from the variable
environment) for the function body outside of strict mode
info: |
[...]
29. If strict is false, then
a. Let lexEnv be NewDeclarativeEnvironment(varEnv).
b. NOTE: Non-strict functions use a separate lexical Environment Record
for top-level lexical declarations so that a direct eval can
determine whether any var scoped declarations introduced by the eval
code conflict with pre-existing top-level lexically scoped
declarations. This is not needed for strict functions because a
strict direct eval always places all declarations into a new
Environment Record.
[...]
18.2.1.3 Runtime Semantics: EvalDeclarationInstantiation
[...]
5. If strict is false, then
[...]
b. Let thisLex be lexEnv.
c. Assert: The following loop will terminate.
d. Repeat while thisLex is not the same as varEnv,
i. Let thisEnvRec be thisLex's EnvironmentRecord.
ii. If thisEnvRec is not an object Environment Record, then
1. NOTE: The environment of with statements cannot contain any
lexical declaration so it doesn't need to be checked for
var/let hoisting conflicts.
2. For each name in varNames, do
a. If thisEnvRec.HasBinding(name) is true, then
i. Throw a SyntaxError exception.
ii. NOTE: Annex B.3.5 defines alternate semantics for the
above step.
b. NOTE: A direct eval will not hoist var declaration over a
like-named lexical declaration.
iii. Let thisLex be thisLex's outer environment reference.
flags: [noStrict]
features: [let]
--- |
2135 |
scope-name-var-close.js |
---
esid: sec-function-definitions-runtime-semantics-evaluation
description: Removal of variable environment for the BindingIdentifier
info: |
[...]
2. Let scope be the running execution context's LexicalEnvironment.
3. Let funcEnv be NewDeclarativeEnvironment(scope).
4. Let envRec be funcEnv's EnvironmentRecord.
5. Let name be StringValue of BindingIdentifier.
6. Perform envRec.CreateImmutableBinding(name, false).
7. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
funcEnv, strict).
[...]
--- |
895 |
scope-name-var-open-non-strict.js |
---
esid: sec-function-definitions-runtime-semantics-evaluation
description: >
Creation of new variable environment for the BindingIdentifier
parameter
info: |
[...]
2. Let scope be the running execution context's LexicalEnvironment.
3. Let funcEnv be NewDeclarativeEnvironment(scope).
4. Let envRec be funcEnv's EnvironmentRecord.
5. Let name be StringValue of BindingIdentifier.
6. Perform envRec.CreateImmutableBinding(name, false).
7. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
funcEnv, strict).
[...]
flags: [noStrict]
--- |
1584 |
scope-name-var-open-strict-strict.js |
---
esid: sec-function-definitions-runtime-semantics-evaluation
description: >
Creation of new variable environment for the BindingIdentifier
parameter
info: |
[...]
2. Let scope be the running execution context's LexicalEnvironment.
3. Let funcEnv be NewDeclarativeEnvironment(scope).
4. Let envRec be funcEnv's EnvironmentRecord.
5. Let name be StringValue of BindingIdentifier.
6. Perform envRec.CreateImmutableBinding(name, false).
7. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
funcEnv, strict).
[...]
flags: [onlyStrict]
--- |
1762 |
scope-param-elem-var-close.js |
---
esid: sec-functiondeclarationinstantiation
description: >
sloppy direct evals in params introduce vars
info: |
[...]
20. Else,
a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared.
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
c. Let env be NewDeclarativeEnvironment(calleeEnv).
d. Let envRec be env's EnvironmentRecord.
[...]
flags: [noStrict]
--- |
1056 |
scope-param-elem-var-open.js |
---
esid: sec-functiondeclarationinstantiation
description: >
sloppy direct evals in params introduce vars
info: |
[...]
20. Else,
a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared.
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
c. Let env be NewDeclarativeEnvironment(calleeEnv).
d. Let envRec be env's EnvironmentRecord.
[...]
flags: [noStrict]
--- |
964 |
scope-param-rest-elem-var-close.js |
---
esid: sec-functiondeclarationinstantiation
description: >
sloppy direct evals in params introduce vars
info: |
[...]
20. Else,
a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared.
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
c. Let env be NewDeclarativeEnvironment(calleeEnv).
d. Let envRec be env's EnvironmentRecord.
[...]
flags: [noStrict]
--- |
984 |
scope-param-rest-elem-var-open.js |
---
esid: sec-functiondeclarationinstantiation
description: >
sloppy direct evals in params introduce vars
info: |
[...]
20. Else,
a. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared.
b. Let calleeEnv be the LexicalEnvironment of calleeContext.
c. Let env be NewDeclarativeEnvironment(calleeEnv).
d. Let envRec be env's EnvironmentRecord.
[...]
flags: [noStrict]
--- |
969 |
scope-paramsbody-var-close.js |
---
esid: sec-functiondeclarationinstantiation
description: >
Removal of variable environment for the function body
info: |
[...]
26. If hasParameterExpressions is false, then
[...]
27. Else,
a. NOTE A separate Environment Record is needed to ensure that closures
created by expressions in the formal parameter list do not have
visibility of declarations in the function body.
b. Let varEnv be NewDeclarativeEnvironment(env).
c. Let varEnvRec be varEnv's EnvironmentRecord.
d. Set the VariableEnvironment of calleeContext to varEnv.
e. Let instantiatedVarNames be a new empty List.
[...]
--- |
1128 |
scope-paramsbody-var-open.js |
---
esid: sec-functiondeclarationinstantiation
description: >
Creation of new variable environment for the function body (as distinct from
that for the function's parameters)
info: |
[...]
26. If hasParameterExpressions is false, then
[...]
27. Else,
a. NOTE A separate Environment Record is needed to ensure that closures
created by expressions in the formal parameter list do not have
visibility of declarations in the function body.
b. Let varEnv be NewDeclarativeEnvironment(env).
c. Let varEnvRec be varEnv's EnvironmentRecord.
d. Set the VariableEnvironment of calleeContext to varEnv.
e. Let instantiatedVarNames be a new empty List.
[...]
--- |
1170 |
shell.js |
|
0 |
static-init-await-binding.js |
---
esid: sec-class-definitions-static-semantics-early-errors
description: The `await` keyword is interpreted as an IdentifierReference within function expressions
info: |
ClassStaticBlockBody : ClassStaticBlockStatementList
[...]
- It is a Syntax Error if ContainsAwait of ClassStaticBlockStatementList is true.
features: [class-static-block]
--- |
579 |
static-init-await-reference.js |
---
esid: sec-class-definitions-static-semantics-early-errors
description: The `await` keyword is interpreted as an IdentifierReference within function expressions
info: |
ClassStaticBlockBody : ClassStaticBlockStatementList
[...]
- It is a Syntax Error if ContainsAwait of ClassStaticBlockStatementList is true.
features: [class-static-block]
--- |
757 |
unscopables-with-in-nested-fn.js |
---
description: Symbol.unscopables behavior across scope boundaries (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [globalThis, Symbol.unscopables]
flags: [generated, noStrict]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
...
Let envRec be lex's EnvironmentRecord.
Let exists be ? envRec.HasBinding(name).
HasBinding
...
If the withEnvironment flag of envRec is false, return true.
Let unscopables be ? Get(bindings, @@unscopables).
If Type(unscopables) is Object, then
Let blocked be ToBoolean(? Get(unscopables, N)).
If blocked is true, return false.
(The `with` Statement) Runtime Semantics: Evaluation
...
Set the withEnvironment flag of newEnv’s EnvironmentRecord to true.
...
--- |
2771 |
unscopables-with.js |
---
description: Symbol.unscopables behavior across scope boundaries (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
features: [globalThis, Symbol.unscopables]
flags: [generated, noStrict]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
[...]
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
scope, strict).
[...]
9.2.1 [[Call]] ( thisArgument, argumentsList)
[...]
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
[...]
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
[...]
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
[...]
23. Let iteratorRecord be Record {[[iterator]]:
CreateListIterator(argumentsList), [[done]]: false}.
24. If hasDuplicates is true, then
[...]
25. Else,
b. Let formalStatus be IteratorBindingInitialization for formals with
iteratorRecord and env as arguments.
[...]
...
Let envRec be lex's EnvironmentRecord.
Let exists be ? envRec.HasBinding(name).
HasBinding
...
If the withEnvironment flag of envRec is false, return true.
Let unscopables be ? Get(bindings, @@unscopables).
If Type(unscopables) is Object, then
Let blocked be ToBoolean(? Get(unscopables, N)).
If blocked is true, return false.
(The `with` Statement) Runtime Semantics: Evaluation
...
Set the withEnvironment flag of newEnv’s EnvironmentRecord to true.
...
--- |
2596 |
use-strict-with-non-simple-param.js |
---
esid: sec-function-definitions-static-semantics-early-errors
description: >
A SyntaxError is thrown if a function contains a non-simple parameter list and a UseStrict directive.
info: |
Static Semantics: Early Errors
It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false.
negative:
phase: parse
type: SyntaxError
--- |
629 |