mirror of
https://github.com/tc39/test262.git
synced 2025-07-20 12:34:41 +02:00
Merge pull request #2465 from bocoup/eval-param-only-sloppy
Test cases for new ReferenceError: remove class tests and add no-strict
This commit is contained in:
commit
20ca8e3568
49
src/function-forms/error-no-strict/arrow-function.template
Normal file
49
src/function-forms/error-no-strict/arrow-function.template
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/expressions/arrow-function/
|
||||||
|
name: arrow function expression in sloppy code
|
||||||
|
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
ArrowFunction : ArrowParameters => ConciseBody
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, 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.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f;
|
||||||
|
f = (/*{ params }*/) => {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
f(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'arrow function body not evaluated');
|
@ -0,0 +1,46 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-arrow-function/
|
||||||
|
name: async arrow function expression in sloppy code
|
||||||
|
esid: sec-async-arrow-function-definitions
|
||||||
|
info: |
|
||||||
|
14.7 Async Arrow Function Definitions
|
||||||
|
|
||||||
|
AsyncArrowFunction :
|
||||||
|
...
|
||||||
|
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
|
||||||
|
|
||||||
|
AsyncConciseBody :
|
||||||
|
{ AsyncFunctionBody }
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
Supplemental Syntax
|
||||||
|
|
||||||
|
When processing an instance of the production AsyncArrowFunction :
|
||||||
|
CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody the interpretation of
|
||||||
|
CoverCallExpressionAndAsyncArrowHead is refined using the following grammar:
|
||||||
|
|
||||||
|
AsyncArrowHead :
|
||||||
|
async ArrowFormalParameters
|
||||||
|
flags: [async, noStrict]
|
||||||
|
features: [async-functions]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f;
|
||||||
|
f = async (/*{ params }*/) => {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
f(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
30
src/function-forms/error-no-strict/async-func-decl.template
Normal file
30
src/function-forms/error-no-strict/async-func-decl.template
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/statements/async-function/
|
||||||
|
name: async function declaration in sloppy code
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionDeclaration :
|
||||||
|
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async, noStrict]
|
||||||
|
features: [async-functions]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
async function f(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
f(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-function/named-
|
||||||
|
name: async function named expression in sloppy code
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionExpression :
|
||||||
|
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async, noStrict]
|
||||||
|
features: [async-functions]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f = async function f(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
f(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-function/nameless-
|
||||||
|
name: async function nameless expression in sloppy code
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncFunctionExpression :
|
||||||
|
async function ( FormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async, noStrict]
|
||||||
|
features: [async-functions]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f = async function(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
f(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/statements/async-generator/
|
||||||
|
name: async generator function declaration in sloppy code
|
||||||
|
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier
|
||||||
|
( FormalParameters ) { AsyncGeneratorBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody,
|
||||||
|
scope, strict).
|
||||||
|
[...]
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
async function* f(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
f(/*{ args }*/);
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 0, 'generator function body not evaluated');
|
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-generator/
|
||||||
|
name: async generator function expression in sloppy code
|
||||||
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||||
|
AsyncGeneratorBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||||
|
AsyncGeneratorBody, scope, strict).
|
||||||
|
[...]
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f;
|
||||||
|
f = async function*(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
f(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'generator function body not evaluated');
|
35
src/function-forms/error-no-strict/async-gen-meth.template
Normal file
35
src/function-forms/error-no-strict/async-gen-meth.template
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/expressions/object/method-definition/async-gen-meth-
|
||||||
|
name: async generator method in sloppy code
|
||||||
|
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
AsyncGeneratorMethod :
|
||||||
|
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
||||||
|
{ AsyncGeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
||||||
|
Otherwise let strict be false.
|
||||||
|
4. Let scope be the running execution context's LexicalEnvironment.
|
||||||
|
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
||||||
|
AsyncGeneratorBody, scope, strict).
|
||||||
|
[...]
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var obj = {
|
||||||
|
async *method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
obj.method(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'generator method body not evaluated');
|
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/async-generator/named-
|
||||||
|
name: async generator named function expression in sloppy code
|
||||||
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||||
|
( FormalParameters ) { AsyncGeneratorBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||||
|
AsyncGeneratorBody, funcEnv, strict).
|
||||||
|
[...]
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f;
|
||||||
|
f = async function* g(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
f(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'generator function body not evaluated');
|
33
src/function-forms/error-no-strict/async-meth.template
Normal file
33
src/function-forms/error-no-strict/async-meth.template
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// Copyright (C) 2017 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
path: language/expressions/object/method-definition/async-meth-
|
||||||
|
name: async method in sloppy code
|
||||||
|
esid: sec-async-function-definitions
|
||||||
|
info: |
|
||||||
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
AsyncMethod :
|
||||||
|
async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||||
|
flags: [async, noStrict]
|
||||||
|
features: [async-functions]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
|
||||||
|
var obj = {
|
||||||
|
async method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
obj.method(/*{ args }*/)
|
||||||
|
.then(_ => {
|
||||||
|
throw new Test262Error('function should not be resolved');
|
||||||
|
}, error => assert.sameValue(error.constructor, /*{ error }*/))
|
||||||
|
.then(() => {
|
||||||
|
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
||||||
|
}, $DONE)
|
||||||
|
.then($DONE, $DONE);
|
49
src/function-forms/error-no-strict/func-decl.template
Normal file
49
src/function-forms/error-no-strict/func-decl.template
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/statements/function/
|
||||||
|
name: function declaration in sloppy code
|
||||||
|
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
FunctionDeclaration :
|
||||||
|
function BindingIdentifier ( FormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
3. Let F 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.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
function f(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
f(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'function body not evaluated');
|
50
src/function-forms/error-no-strict/func-expr.template
Normal file
50
src/function-forms/error-no-strict/func-expr.template
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/expressions/function/
|
||||||
|
name: function expression in sloppy code
|
||||||
|
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||||
|
flags: [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.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f;
|
||||||
|
f = function(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
f(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'function body not evaluated');
|
51
src/function-forms/error-no-strict/gen-func-decl.template
Normal file
51
src/function-forms/error-no-strict/gen-func-decl.template
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/statements/generators/
|
||||||
|
name: generator function declaration in sloppy code
|
||||||
|
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. Let F be GeneratorFunctionCreate(Normal, FormalParameters,
|
||||||
|
GeneratorBody, 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.
|
||||||
|
[...]
|
||||||
|
features: [generators]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
function* f(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
f(/*{ args }*/);
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(callCount, 0, 'generator function body not evaluated');
|
51
src/function-forms/error-no-strict/gen-func-expr.template
Normal file
51
src/function-forms/error-no-strict/gen-func-expr.template
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/expressions/generators/
|
||||||
|
name: generator function expression in sloppy code
|
||||||
|
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
|
||||||
|
GeneratorBody, 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.
|
||||||
|
[...]
|
||||||
|
features: [generators]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var f;
|
||||||
|
f = function*(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
f(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'generator function body not evaluated');
|
57
src/function-forms/error-no-strict/gen-meth.template
Normal file
57
src/function-forms/error-no-strict/gen-meth.template
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/expressions/object/method-definition/gen-meth-
|
||||||
|
name: generator method in sloppy code
|
||||||
|
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
GeneratorMethod :
|
||||||
|
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod is strict mode code,
|
||||||
|
let strict be true. Otherwise let strict be false.
|
||||||
|
4. Let scope be the running execution context's LexicalEnvironment.
|
||||||
|
5. Let closure be GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, 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.
|
||||||
|
[...]
|
||||||
|
features: [generators]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var obj = {
|
||||||
|
*method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
obj.method(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'generator method body not evaluated');
|
53
src/function-forms/error-no-strict/meth.template
Normal file
53
src/function-forms/error-no-strict/meth.template
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/expressions/object/method-definition/meth-
|
||||||
|
name: method in sloppy code
|
||||||
|
esid: sec-runtime-semantics-definemethod
|
||||||
|
flags: [noStrict]
|
||||||
|
info: |
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters,
|
||||||
|
FunctionBody, scope, strict). If functionPrototype was passed as a
|
||||||
|
parameter then pass its value as the functionPrototype optional argument
|
||||||
|
of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var obj = {
|
||||||
|
method(/*{ params }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
assert.throws(/*{ error }*/, function() {
|
||||||
|
obj.method(/*{ args }*/);
|
||||||
|
});
|
||||||
|
assert.sameValue(callCount, 0, 'method body not evaluated');
|
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
desc: sloppy direct eval in params introduces var
|
desc: sloppy direct eval in params introduces var
|
||||||
template: error
|
template: error-no-strict
|
||||||
info: |
|
info: |
|
||||||
|
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
Runtime Semantics: IteratorBindingInitialization
|
||||||
@ -12,7 +12,6 @@ info: |
|
|||||||
|
|
||||||
|
|
||||||
features: [default-parameters]
|
features: [default-parameters]
|
||||||
flags: [noStrict]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- params
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/arrow-function.template
|
// - src/function-forms/error-no-strict/arrow-function.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (arrow function expression)
|
description: sloppy direct eval in params introduces var (arrow function expression in sloppy code)
|
||||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||||
features: [default-parameters]
|
features: [default-parameters]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-arrow-function.template
|
// - src/function-forms/error-no-strict/async-arrow-function.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async arrow function expression)
|
description: sloppy direct eval in params introduces var (async arrow function expression in sloppy code)
|
||||||
esid: sec-async-arrow-function-definitions
|
esid: sec-async-arrow-function-definitions
|
||||||
features: [default-parameters, async-functions]
|
features: [default-parameters, async-functions]
|
||||||
flags: [generated, noStrict, async]
|
flags: [generated, async, noStrict]
|
||||||
info: |
|
info: |
|
||||||
14.7 Async Arrow Function Definitions
|
14.7 Async Arrow Function Definitions
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-func-expr-named.template
|
// - src/function-forms/error-no-strict/async-func-expr-named.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async function named expression)
|
description: sloppy direct eval in params introduces var (async function named expression in sloppy code)
|
||||||
esid: sec-async-function-definitions
|
esid: sec-async-function-definitions
|
||||||
features: [default-parameters, async-functions]
|
features: [default-parameters, async-functions]
|
||||||
flags: [generated, noStrict, async]
|
flags: [generated, async, noStrict]
|
||||||
info: |
|
info: |
|
||||||
14.6 Async Function Definitions
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-func-expr-nameless.template
|
// - src/function-forms/error-no-strict/async-func-expr-nameless.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async function nameless expression)
|
description: sloppy direct eval in params introduces var (async function nameless expression in sloppy code)
|
||||||
esid: sec-async-function-definitions
|
esid: sec-async-function-definitions
|
||||||
features: [default-parameters, async-functions]
|
features: [default-parameters, async-functions]
|
||||||
flags: [generated, noStrict, async]
|
flags: [generated, async, noStrict]
|
||||||
info: |
|
info: |
|
||||||
14.6 Async Function Definitions
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-gen-func-expr.template
|
// - src/function-forms/error-no-strict/async-gen-func-expr.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async generator function expression)
|
description: sloppy direct eval in params introduces var (async generator function expression in sloppy code)
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
features: [default-parameters, async-iteration]
|
features: [default-parameters, async-iteration]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-gen-named-func-expr.template
|
// - src/function-forms/error-no-strict/async-gen-named-func-expr.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async generator named function expression)
|
description: sloppy direct eval in params introduces var (async generator named function expression in sloppy code)
|
||||||
esid: sec-asyncgenerator-definitions-evaluation
|
esid: sec-asyncgenerator-definitions-evaluation
|
||||||
features: [default-parameters, async-iteration]
|
features: [default-parameters, async-iteration]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-expr-async-gen-meth-static.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (static class expression async generator method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, async-iteration]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassExpression : class BindingIdentifieropt ClassTail
|
|
||||||
|
|
||||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
|
||||||
2. Else, let className be StringValue of BindingIdentifier.
|
|
||||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
|
||||||
with argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
b. Else,
|
|
||||||
Let status be the result of performing PropertyDefinitionEvaluation
|
|
||||||
for m with arguments F and false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
AsyncGeneratorMethod :
|
|
||||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
|
||||||
{ AsyncGeneratorBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
|
||||||
Otherwise let strict be false.
|
|
||||||
4. Let scope be the running execution context's LexicalEnvironment.
|
|
||||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
|
||||||
AsyncGeneratorBody, scope, strict).
|
|
||||||
[...]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
|
||||||
FormalParameter : BindingElement
|
|
||||||
|
|
||||||
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
var C = class {
|
|
||||||
static async *method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,83 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-expr-async-gen-meth.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (class expression async generator method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, async-iteration]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassExpression : class BindingIdentifieropt ClassTail
|
|
||||||
|
|
||||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
|
||||||
2. Else, let className be StringValue of BindingIdentifier.
|
|
||||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
|
||||||
with argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
i. Let status be the result of performing
|
|
||||||
PropertyDefinitionEvaluation for m with arguments proto and
|
|
||||||
false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
GeneratorMethod :
|
|
||||||
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this GeneratorMethod is strict mode code,
|
|
||||||
let strict be true. Otherwise let strict be false.
|
|
||||||
4. Let scope be the running execution context's LexicalEnvironment.
|
|
||||||
5. Let closure be GeneratorFunctionCreate(Method,
|
|
||||||
StrictFormalParameters, GeneratorBody, 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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
var C = class {
|
|
||||||
async *method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.prototype.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,66 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-expr-async-meth-static.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (static class expression async method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, async-functions]
|
|
||||||
flags: [generated, noStrict, async]
|
|
||||||
info: |
|
|
||||||
ClassExpression : class BindingIdentifieropt ClassTail
|
|
||||||
|
|
||||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
|
||||||
2. Else, let className be StringValue of BindingIdentifier.
|
|
||||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
|
||||||
with argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
b. Else,
|
|
||||||
Let status be the result of performing PropertyDefinitionEvaluation
|
|
||||||
for m with arguments F and false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
|
||||||
let strict be false.
|
|
||||||
4. Let scope be the LexicalEnvironment of the running execution context.
|
|
||||||
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
|
||||||
scope, strict).
|
|
||||||
[...]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
|
||||||
FormalParameter : BindingElement
|
|
||||||
|
|
||||||
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
|
|
||||||
var C = class {
|
|
||||||
static async method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
C.method()
|
|
||||||
.then(_ => {
|
|
||||||
throw new Test262Error('function should not be resolved');
|
|
||||||
}, error => assert.sameValue(error.constructor, SyntaxError))
|
|
||||||
.then(() => {
|
|
||||||
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
|
||||||
}, $DONE)
|
|
||||||
.then($DONE, $DONE);
|
|
@ -1,65 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-expr-async-meth.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (class expression async method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, async-functions]
|
|
||||||
flags: [generated, noStrict, async]
|
|
||||||
info: |
|
|
||||||
ClassExpression : class BindingIdentifieropt ClassTail
|
|
||||||
|
|
||||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
|
||||||
2. Else, let className be StringValue of BindingIdentifier.
|
|
||||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
|
||||||
with argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
i. Let status be the result of performing
|
|
||||||
PropertyDefinitionEvaluation for m with arguments proto and
|
|
||||||
false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
|
||||||
let strict be false.
|
|
||||||
4. Let scope be the LexicalEnvironment of the running execution context.
|
|
||||||
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
|
||||||
scope, strict).
|
|
||||||
[...]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
|
||||||
FormalParameter : BindingElement
|
|
||||||
|
|
||||||
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
var C = class {
|
|
||||||
async method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
C.prototype.method()
|
|
||||||
.then(_ => {
|
|
||||||
throw new Test262Error('function should not be resolved');
|
|
||||||
}, error => assert.sameValue(error.constructor, SyntaxError))
|
|
||||||
.then(() => {
|
|
||||||
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
|
||||||
}, $DONE)
|
|
||||||
.then($DONE, $DONE);
|
|
@ -1,83 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-expr-gen-meth-static.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (static class expression generator method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, generators]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassExpression : class BindingIdentifieropt ClassTail
|
|
||||||
|
|
||||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
|
||||||
2. Else, let className be StringValue of BindingIdentifier.
|
|
||||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
|
||||||
with argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
b. Else,
|
|
||||||
Let status be the result of performing PropertyDefinitionEvaluation
|
|
||||||
for m with arguments F and false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
GeneratorMethod :
|
|
||||||
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this GeneratorMethod is strict mode code,
|
|
||||||
let strict be true. Otherwise let strict be false.
|
|
||||||
4. Let scope be the running execution context's LexicalEnvironment.
|
|
||||||
5. Let closure be GeneratorFunctionCreate(Method,
|
|
||||||
StrictFormalParameters, GeneratorBody, 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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
var C = class {
|
|
||||||
static *method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,83 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-expr-gen-meth.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (class expression method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, generators]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassExpression : class BindingIdentifieropt ClassTail
|
|
||||||
|
|
||||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
|
||||||
2. Else, let className be StringValue of BindingIdentifier.
|
|
||||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
|
||||||
with argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
i. Let status be the result of performing
|
|
||||||
PropertyDefinitionEvaluation for m with arguments proto and
|
|
||||||
false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
GeneratorMethod :
|
|
||||||
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this GeneratorMethod is strict mode code,
|
|
||||||
let strict be true. Otherwise let strict be false.
|
|
||||||
4. Let scope be the running execution context's LexicalEnvironment.
|
|
||||||
5. Let closure be GeneratorFunctionCreate(Method,
|
|
||||||
StrictFormalParameters, GeneratorBody, 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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
var C = class {
|
|
||||||
*method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.prototype.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,79 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-expr-meth-static.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (static class expression method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassExpression : class BindingIdentifieropt ClassTail
|
|
||||||
|
|
||||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
|
||||||
2. Else, let className be StringValue of BindingIdentifier.
|
|
||||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
|
||||||
with argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
b. Else,
|
|
||||||
Let status be the result of performing PropertyDefinitionEvaluation for
|
|
||||||
m with arguments F and false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.3.8 Runtime Semantics: DefineMethod
|
|
||||||
|
|
||||||
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
|
||||||
|
|
||||||
[...]
|
|
||||||
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
|
||||||
scope, strict). If functionPrototype was passed as a parameter then pass its
|
|
||||||
value as the functionPrototype optional argument of FunctionCreate.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
var C = class {
|
|
||||||
static method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,79 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-expr-meth.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (class expression method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassExpression : class BindingIdentifieropt ClassTail
|
|
||||||
|
|
||||||
1. If BindingIdentifieropt is not present, let className be undefined.
|
|
||||||
2. Else, let className be StringValue of BindingIdentifier.
|
|
||||||
3. Let value be the result of ClassDefinitionEvaluation of ClassTail
|
|
||||||
with argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
i. Let status be the result of performing
|
|
||||||
PropertyDefinitionEvaluation for m with arguments proto and
|
|
||||||
false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.3.8 Runtime Semantics: DefineMethod
|
|
||||||
|
|
||||||
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
|
||||||
|
|
||||||
[...]
|
|
||||||
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
|
||||||
scope, strict). If functionPrototype was passed as a parameter then pass its
|
|
||||||
value as the functionPrototype optional argument of FunctionCreate.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
var C = class {
|
|
||||||
method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.prototype.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/func-expr.template
|
// - src/function-forms/error-no-strict/func-expr.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (function expression)
|
description: sloppy direct eval in params introduces var (function expression in sloppy code)
|
||||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||||
features: [default-parameters]
|
features: [default-parameters]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/gen-func-expr.template
|
// - src/function-forms/error-no-strict/gen-func-expr.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (generator function expression)
|
description: sloppy direct eval in params introduces var (generator function expression in sloppy code)
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||||
features: [default-parameters, generators]
|
features: [default-parameters, generators]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-gen-meth.template
|
// - src/function-forms/error-no-strict/async-gen-meth.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async generator method)
|
description: sloppy direct eval in params introduces var (async generator method in sloppy code)
|
||||||
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
esid: sec-asyncgenerator-definitions-propertydefinitionevaluation
|
||||||
features: [default-parameters, async-iteration]
|
features: [default-parameters, async-iteration]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-meth.template
|
// - src/function-forms/error-no-strict/async-meth.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async method)
|
description: sloppy direct eval in params introduces var (async method in sloppy code)
|
||||||
esid: sec-async-function-definitions
|
esid: sec-async-function-definitions
|
||||||
features: [default-parameters, async-functions]
|
features: [default-parameters, async-functions]
|
||||||
flags: [generated, noStrict, async]
|
flags: [generated, async, noStrict]
|
||||||
info: |
|
info: |
|
||||||
14.6 Async Function Definitions
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/gen-meth.template
|
// - src/function-forms/error-no-strict/gen-meth.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (generator method)
|
description: sloppy direct eval in params introduces var (generator method in sloppy code)
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
||||||
features: [default-parameters, generators]
|
features: [default-parameters, generators]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/meth.template
|
// - src/function-forms/error-no-strict/meth.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (method)
|
description: sloppy direct eval in params introduces var (method in sloppy code)
|
||||||
esid: sec-runtime-semantics-definemethod
|
esid: sec-runtime-semantics-definemethod
|
||||||
features: [default-parameters]
|
features: [default-parameters]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-func-decl.template
|
// - src/function-forms/error-no-strict/async-func-decl.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async function declaration)
|
description: sloppy direct eval in params introduces var (async function declaration in sloppy code)
|
||||||
esid: sec-async-function-definitions
|
esid: sec-async-function-definitions
|
||||||
features: [default-parameters, async-functions]
|
features: [default-parameters, async-functions]
|
||||||
flags: [generated, noStrict, async]
|
flags: [generated, async, noStrict]
|
||||||
info: |
|
info: |
|
||||||
14.6 Async Function Definitions
|
14.6 Async Function Definitions
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/async-gen-func-decl.template
|
// - src/function-forms/error-no-strict/async-gen-func-decl.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (async generator function declaration)
|
description: sloppy direct eval in params introduces var (async generator function declaration in sloppy code)
|
||||||
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
esid: sec-asyncgenerator-definitions-instantiatefunctionobject
|
||||||
features: [default-parameters, async-iteration]
|
features: [default-parameters, async-iteration]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-decl-async-gen-meth-static.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (static class expression generator method)
|
|
||||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
|
||||||
features: [default-parameters, async-iteration]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassDeclaration : class BindingIdentifier ClassTail
|
|
||||||
|
|
||||||
1. Let className be StringValue of BindingIdentifier.
|
|
||||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
|
||||||
argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
b. Else,
|
|
||||||
Let status be the result of performing PropertyDefinitionEvaluation for
|
|
||||||
m with arguments F and false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
AsyncGeneratorMethod :
|
|
||||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
|
||||||
{ AsyncGeneratorBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
|
||||||
Otherwise let strict be false.
|
|
||||||
4. Let scope be the running execution context's LexicalEnvironment.
|
|
||||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
|
||||||
AsyncGeneratorBody, scope, strict).
|
|
||||||
[...]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
|
||||||
FormalParameter : BindingElement
|
|
||||||
|
|
||||||
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
class C {
|
|
||||||
static async *method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.method();
|
|
||||||
});
|
|
||||||
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,61 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-decl-async-gen-meth.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (class expression method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, async-iteration]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassDeclaration : class BindingIdentifier ClassTail
|
|
||||||
|
|
||||||
1. Let className be StringValue of BindingIdentifier.
|
|
||||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
|
||||||
argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
i. Let status be the result of performing
|
|
||||||
PropertyDefinitionEvaluation for m with arguments proto and
|
|
||||||
false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
AsyncGeneratorMethod :
|
|
||||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
|
|
||||||
{ AsyncGeneratorBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
|
|
||||||
Otherwise let strict be false.
|
|
||||||
4. Let scope be the running execution context's LexicalEnvironment.
|
|
||||||
5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
|
|
||||||
AsyncGeneratorBody, scope, strict).
|
|
||||||
[...]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
|
||||||
FormalParameter : BindingElement
|
|
||||||
|
|
||||||
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
class C {
|
|
||||||
async *method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.prototype.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,64 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-decl-async-meth-static.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (static class declaration async method)
|
|
||||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
|
||||||
features: [default-parameters, async-functions]
|
|
||||||
flags: [generated, noStrict, async]
|
|
||||||
info: |
|
|
||||||
ClassDeclaration : class BindingIdentifier ClassTail
|
|
||||||
|
|
||||||
1. Let className be StringValue of BindingIdentifier.
|
|
||||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
|
||||||
argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
b. Else,
|
|
||||||
Let status be the result of performing PropertyDefinitionEvaluation for
|
|
||||||
m with arguments F and false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
|
||||||
let strict be false.
|
|
||||||
4. Let scope be the LexicalEnvironment of the running execution context.
|
|
||||||
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
|
||||||
scope, strict).
|
|
||||||
[...]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
|
||||||
FormalParameter : BindingElement
|
|
||||||
|
|
||||||
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
class C {
|
|
||||||
static async method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
C.method()
|
|
||||||
.then(_ => {
|
|
||||||
throw new Test262Error('function should not be resolved');
|
|
||||||
}, error => assert.sameValue(error.constructor, SyntaxError))
|
|
||||||
.then(() => {
|
|
||||||
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
|
||||||
}, $DONE)
|
|
||||||
.then($DONE, $DONE);
|
|
@ -1,64 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-decl-async-meth.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (class declaration async method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, async-functions]
|
|
||||||
flags: [generated, noStrict, async]
|
|
||||||
info: |
|
|
||||||
ClassDeclaration : class BindingIdentifier ClassTail
|
|
||||||
|
|
||||||
1. Let className be StringValue of BindingIdentifier.
|
|
||||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
|
||||||
argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
i. Let status be the result of performing
|
|
||||||
PropertyDefinitionEvaluation for m with arguments proto and
|
|
||||||
false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
|
|
||||||
let strict be false.
|
|
||||||
4. Let scope be the LexicalEnvironment of the running execution context.
|
|
||||||
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
|
|
||||||
scope, strict).
|
|
||||||
[...]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Runtime Semantics: IteratorBindingInitialization
|
|
||||||
FormalParameter : BindingElement
|
|
||||||
|
|
||||||
1. Return the result of performing IteratorBindingInitialization for BindingElement with arguments iteratorRecord and environment.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
class C {
|
|
||||||
async method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
C.prototype.method()
|
|
||||||
.then(_ => {
|
|
||||||
throw new Test262Error('function should not be resolved');
|
|
||||||
}, error => assert.sameValue(error.constructor, SyntaxError))
|
|
||||||
.then(() => {
|
|
||||||
assert.sameValue(callCount, 0, 'function body is not evaluated');
|
|
||||||
}, $DONE)
|
|
||||||
.then($DONE, $DONE);
|
|
@ -1,82 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-decl-gen-meth-static.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (static class expression generator method)
|
|
||||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
|
||||||
features: [default-parameters, generators]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassDeclaration : class BindingIdentifier ClassTail
|
|
||||||
|
|
||||||
1. Let className be StringValue of BindingIdentifier.
|
|
||||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
|
||||||
argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
b. Else,
|
|
||||||
Let status be the result of performing PropertyDefinitionEvaluation for
|
|
||||||
m with arguments F and false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this GeneratorMethod is strict mode code,
|
|
||||||
let strict be true. Otherwise let strict be false.
|
|
||||||
4. Let scope be the running execution context's LexicalEnvironment.
|
|
||||||
5. Let closure be GeneratorFunctionCreate(Method,
|
|
||||||
StrictFormalParameters, GeneratorBody, 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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
class C {
|
|
||||||
static *method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.method();
|
|
||||||
});
|
|
||||||
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,81 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-decl-gen-meth.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (class expression method)
|
|
||||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
|
||||||
features: [default-parameters, generators]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassDeclaration : class BindingIdentifier ClassTail
|
|
||||||
|
|
||||||
1. Let className be StringValue of BindingIdentifier.
|
|
||||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
|
||||||
argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
i. Let status be the result of performing
|
|
||||||
PropertyDefinitionEvaluation for m with arguments proto and
|
|
||||||
false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
|
||||||
|
|
||||||
GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
|
||||||
|
|
||||||
1. Let propKey be the result of evaluating PropertyName.
|
|
||||||
2. ReturnIfAbrupt(propKey).
|
|
||||||
3. If the function code for this GeneratorMethod is strict mode code,
|
|
||||||
let strict be true. Otherwise let strict be false.
|
|
||||||
4. Let scope be the running execution context's LexicalEnvironment.
|
|
||||||
5. Let closure be GeneratorFunctionCreate(Method,
|
|
||||||
StrictFormalParameters, GeneratorBody, 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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
class C {
|
|
||||||
*method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.prototype.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,78 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-decl-meth-static.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (static class expression method)
|
|
||||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
|
||||||
features: [default-parameters]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassDeclaration : class BindingIdentifier ClassTail
|
|
||||||
|
|
||||||
1. Let className be StringValue of BindingIdentifier.
|
|
||||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
|
||||||
argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
b. Else,
|
|
||||||
Let status be the result of performing PropertyDefinitionEvaluation for
|
|
||||||
m with arguments F and false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.3.8 Runtime Semantics: DefineMethod
|
|
||||||
|
|
||||||
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
|
||||||
|
|
||||||
[...]
|
|
||||||
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
|
||||||
scope, strict). If functionPrototype was passed as a parameter then pass its
|
|
||||||
value as the functionPrototype optional argument of FunctionCreate.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
class C {
|
|
||||||
static method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,78 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
|
||||||
// - src/function-forms/error/cls-decl-meth.template
|
|
||||||
/*---
|
|
||||||
description: sloppy direct eval in params introduces var (class expression method)
|
|
||||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
|
||||||
features: [default-parameters]
|
|
||||||
flags: [generated, noStrict]
|
|
||||||
info: |
|
|
||||||
ClassDeclaration : class BindingIdentifier ClassTail
|
|
||||||
|
|
||||||
1. Let className be StringValue of BindingIdentifier.
|
|
||||||
2. Let value be the result of ClassDefinitionEvaluation of ClassTail with
|
|
||||||
argument className.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.5.14 Runtime Semantics: ClassDefinitionEvaluation
|
|
||||||
|
|
||||||
21. For each ClassElement m in order from methods
|
|
||||||
a. If IsStatic of m is false, then
|
|
||||||
i. Let status be the result of performing
|
|
||||||
PropertyDefinitionEvaluation for m with arguments proto and
|
|
||||||
false.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
14.3.8 Runtime Semantics: DefineMethod
|
|
||||||
|
|
||||||
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
|
||||||
|
|
||||||
[...]
|
|
||||||
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
|
||||||
scope, strict). If functionPrototype was passed as a parameter then pass its
|
|
||||||
value as the functionPrototype optional argument of FunctionCreate.
|
|
||||||
[...]
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
var callCount = 0;
|
|
||||||
class C {
|
|
||||||
method(a = eval("var a = 42")) {
|
|
||||||
|
|
||||||
callCount = callCount + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
|
||||||
C.prototype.method();
|
|
||||||
});
|
|
||||||
assert.sameValue(callCount, 0, 'method body not evaluated');
|
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/func-decl.template
|
// - src/function-forms/error-no-strict/func-decl.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (function declaration)
|
description: sloppy direct eval in params introduces var (function declaration in sloppy code)
|
||||||
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||||
features: [default-parameters]
|
features: [default-parameters]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/function-forms/eval-var-scope-syntax-err.case
|
// - src/function-forms/eval-var-scope-syntax-err.case
|
||||||
// - src/function-forms/error/gen-func-decl.template
|
// - src/function-forms/error-no-strict/gen-func-decl.template
|
||||||
/*---
|
/*---
|
||||||
description: sloppy direct eval in params introduces var (generator function declaration)
|
description: sloppy direct eval in params introduces var (generator function declaration in sloppy code)
|
||||||
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||||
features: [default-parameters, generators]
|
features: [default-parameters, generators]
|
||||||
flags: [generated, noStrict]
|
flags: [generated, noStrict]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user