mirror of https://github.com/tc39/test262.git
Coverage: read-only function expression name. Closes gh-2896
This commit is contained in:
parent
2e5ff2461b
commit
602c828805
|
@ -0,0 +1,27 @@
|
|||
// Copyright (C) 2020 Rick Waldron. 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 non-strict mode code
|
||||
esid: sec-async-function-definitions
|
||||
info: |
|
||||
Async Function Definitions
|
||||
|
||||
AsyncFunctionExpression :
|
||||
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||
|
||||
flags: [async, noStrict]
|
||||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function BindingIdentifier() {
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
(async () => {
|
||||
assert.sameValue(await ref(), ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/async-function/named-strict-error-
|
||||
name: async function named expression in strict mode code
|
||||
esid: sec-async-function-definitions
|
||||
info: |
|
||||
Async Function Definitions
|
||||
|
||||
AsyncFunctionExpression :
|
||||
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||
|
||||
features: [async-functions]
|
||||
flags: [async, onlyStrict]
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function BindingIdentifier() {
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
(async () => {
|
||||
let catchCount = 0;
|
||||
try {
|
||||
await ref()
|
||||
} catch (error) {
|
||||
catchCount++;
|
||||
assert(error instanceof TypeError);
|
||||
}
|
||||
assert.sameValue(catchCount, 1);
|
||||
assert.sameValue(callCount, 1);
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/async-generator/named-no-strict-
|
||||
name: async generator named function expression in non-strict mode code
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
||||
AsyncGeneratorExpression :
|
||||
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
features: [async-iteration]
|
||||
flags: [async, noStrict]
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function * BindingIdentifier() {
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
(async () => {
|
||||
assert.sameValue((await (await ref()).next()).value, ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/async-generator/named-strict-error-
|
||||
name: async generator named function expression in strict mode code
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
info: |
|
||||
AsyncGeneratorExpression :
|
||||
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
features: [async-iteration]
|
||||
flags: [async, onlyStrict]
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function * BindingIdentifier() {
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
(async () => {
|
||||
let catchCount = 0;
|
||||
try {
|
||||
(await (await ref()).next()).value
|
||||
} catch (error) {
|
||||
catchCount++;
|
||||
assert(error instanceof TypeError);
|
||||
}
|
||||
assert.sameValue(catchCount, 1);
|
||||
assert.sameValue(callCount, 1);
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/function/named-no-strict-
|
||||
name: named function expression in non-strict mode code
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
|
||||
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function BindingIdentifier() {
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
assert.sameValue(ref(), ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/function/named-strict-error-
|
||||
name: named function expression in strict mode code
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
|
||||
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function BindingIdentifier() {
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
ref();
|
||||
});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/generators/named-no-strict-
|
||||
name: named generator function expression in non-strict mode code
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
features: [generators]
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function * BindingIdentifier() {
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
assert.sameValue(ref().next().value, ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/generators/named-strict-error-
|
||||
name: named generator function expression in strict mode code
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
info: |
|
||||
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
features: [generators]
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function * BindingIdentifier() {
|
||||
/*{ body }*/
|
||||
};
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
ref().next();
|
||||
});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Reassignment of function name is silently ignored in non-strict mode code.
|
||||
template: expr-named
|
||||
---*/
|
||||
|
||||
//- body
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Reassignment of function name is silently ignored in non-strict mode code.
|
||||
template: expr-named
|
||||
---*/
|
||||
|
||||
//- body
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
|
@ -0,0 +1,11 @@
|
|||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Reassignment of function name is silently ignored in non-strict mode code.
|
||||
template: expr-named
|
||||
---*/
|
||||
|
||||
//- body
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
|
@ -0,0 +1,31 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-arrow.case
|
||||
// - src/function-forms/expr-named/async-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async function named expression in non-strict mode code)
|
||||
esid: sec-async-function-definitions
|
||||
features: [async-functions]
|
||||
flags: [generated, async, noStrict]
|
||||
info: |
|
||||
Async Function Definitions
|
||||
|
||||
AsyncFunctionExpression :
|
||||
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function BindingIdentifier() {
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
assert.sameValue(await ref(), ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-eval.case
|
||||
// - src/function-forms/expr-named/async-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async function named expression in non-strict mode code)
|
||||
esid: sec-async-function-definitions
|
||||
features: [async-functions]
|
||||
flags: [generated, async, noStrict]
|
||||
info: |
|
||||
Async Function Definitions
|
||||
|
||||
AsyncFunctionExpression :
|
||||
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function BindingIdentifier() {
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
assert.sameValue(await ref(), ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body.case
|
||||
// - src/function-forms/expr-named/async-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async function named expression in non-strict mode code)
|
||||
esid: sec-async-function-definitions
|
||||
features: [async-functions]
|
||||
flags: [generated, async, noStrict]
|
||||
info: |
|
||||
Async Function Definitions
|
||||
|
||||
AsyncFunctionExpression :
|
||||
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function BindingIdentifier() {
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
assert.sameValue(await ref(), ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-arrow.case
|
||||
// - src/function-forms/expr-named/async-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async function named expression in strict mode code)
|
||||
esid: sec-async-function-definitions
|
||||
features: [async-functions]
|
||||
flags: [generated, async, onlyStrict]
|
||||
info: |
|
||||
Async Function Definitions
|
||||
|
||||
AsyncFunctionExpression :
|
||||
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function BindingIdentifier() {
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
let catchCount = 0;
|
||||
try {
|
||||
await ref()
|
||||
} catch (error) {
|
||||
catchCount++;
|
||||
assert(error instanceof TypeError);
|
||||
}
|
||||
assert.sameValue(catchCount, 1);
|
||||
assert.sameValue(callCount, 1);
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-eval.case
|
||||
// - src/function-forms/expr-named/async-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async function named expression in strict mode code)
|
||||
esid: sec-async-function-definitions
|
||||
features: [async-functions]
|
||||
flags: [generated, async, onlyStrict]
|
||||
info: |
|
||||
Async Function Definitions
|
||||
|
||||
AsyncFunctionExpression :
|
||||
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function BindingIdentifier() {
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
let catchCount = 0;
|
||||
try {
|
||||
await ref()
|
||||
} catch (error) {
|
||||
catchCount++;
|
||||
assert(error instanceof TypeError);
|
||||
}
|
||||
assert.sameValue(catchCount, 1);
|
||||
assert.sameValue(callCount, 1);
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body.case
|
||||
// - src/function-forms/expr-named/async-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async function named expression in strict mode code)
|
||||
esid: sec-async-function-definitions
|
||||
features: [async-functions]
|
||||
flags: [generated, async, onlyStrict]
|
||||
info: |
|
||||
Async Function Definitions
|
||||
|
||||
AsyncFunctionExpression :
|
||||
async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function BindingIdentifier() {
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
let catchCount = 0;
|
||||
try {
|
||||
await ref()
|
||||
} catch (error) {
|
||||
catchCount++;
|
||||
assert(error instanceof TypeError);
|
||||
}
|
||||
assert.sameValue(catchCount, 1);
|
||||
assert.sameValue(callCount, 1);
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-arrow.case
|
||||
// - src/function-forms/expr-named/async-gen-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async generator named function expression in non-strict mode code)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async, noStrict]
|
||||
info: |
|
||||
AsyncGeneratorExpression :
|
||||
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function * BindingIdentifier() {
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
assert.sameValue((await (await ref()).next()).value, ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-eval.case
|
||||
// - src/function-forms/expr-named/async-gen-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async generator named function expression in non-strict mode code)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async, noStrict]
|
||||
info: |
|
||||
AsyncGeneratorExpression :
|
||||
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function * BindingIdentifier() {
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
assert.sameValue((await (await ref()).next()).value, ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body.case
|
||||
// - src/function-forms/expr-named/async-gen-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async generator named function expression in non-strict mode code)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async, noStrict]
|
||||
info: |
|
||||
AsyncGeneratorExpression :
|
||||
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function * BindingIdentifier() {
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
assert.sameValue((await (await ref()).next()).value, ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-arrow.case
|
||||
// - src/function-forms/expr-named/async-gen-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async generator named function expression in strict mode code)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async, onlyStrict]
|
||||
info: |
|
||||
AsyncGeneratorExpression :
|
||||
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function * BindingIdentifier() {
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
let catchCount = 0;
|
||||
try {
|
||||
(await (await ref()).next()).value
|
||||
} catch (error) {
|
||||
catchCount++;
|
||||
assert(error instanceof TypeError);
|
||||
}
|
||||
assert.sameValue(catchCount, 1);
|
||||
assert.sameValue(callCount, 1);
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-eval.case
|
||||
// - src/function-forms/expr-named/async-gen-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async generator named function expression in strict mode code)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async, onlyStrict]
|
||||
info: |
|
||||
AsyncGeneratorExpression :
|
||||
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function * BindingIdentifier() {
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
let catchCount = 0;
|
||||
try {
|
||||
(await (await ref()).next()).value
|
||||
} catch (error) {
|
||||
catchCount++;
|
||||
assert(error instanceof TypeError);
|
||||
}
|
||||
assert.sameValue(catchCount, 1);
|
||||
assert.sameValue(callCount, 1);
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body.case
|
||||
// - src/function-forms/expr-named/async-gen-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (async generator named function expression in strict mode code)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async, onlyStrict]
|
||||
info: |
|
||||
AsyncGeneratorExpression :
|
||||
async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = async function * BindingIdentifier() {
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
(async () => {
|
||||
let catchCount = 0;
|
||||
try {
|
||||
(await (await ref()).next()).value
|
||||
} catch (error) {
|
||||
catchCount++;
|
||||
assert(error instanceof TypeError);
|
||||
}
|
||||
assert.sameValue(catchCount, 1);
|
||||
assert.sameValue(callCount, 1);
|
||||
})().then($DONE, $DONE);
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-arrow.case
|
||||
// - src/function-forms/expr-named/func-expr-named-no-strict.template
|
||||
/*---
|
||||
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 }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function BindingIdentifier() {
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.sameValue(ref(), ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,22 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-eval.case
|
||||
// - src/function-forms/expr-named/func-expr-named-no-strict.template
|
||||
/*---
|
||||
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 }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function BindingIdentifier() {
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.sameValue(ref(), ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,22 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body.case
|
||||
// - src/function-forms/expr-named/func-expr-named-no-strict.template
|
||||
/*---
|
||||
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 }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function BindingIdentifier() {
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.sameValue(ref(), ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,26 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-arrow.case
|
||||
// - src/function-forms/expr-named/func-expr-named-strict-error.template
|
||||
/*---
|
||||
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 }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function BindingIdentifier() {
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
ref();
|
||||
});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,24 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-eval.case
|
||||
// - src/function-forms/expr-named/func-expr-named-strict-error.template
|
||||
/*---
|
||||
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 }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function BindingIdentifier() {
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
ref();
|
||||
});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,24 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body.case
|
||||
// - src/function-forms/expr-named/func-expr-named-strict-error.template
|
||||
/*---
|
||||
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 }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function BindingIdentifier() {
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
ref();
|
||||
});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,25 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-arrow.case
|
||||
// - src/function-forms/expr-named/gen-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (named generator function expression in non-strict mode code)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
features: [generators]
|
||||
flags: [generated, noStrict]
|
||||
info: |
|
||||
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function * BindingIdentifier() {
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.sameValue(ref().next().value, ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,23 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-eval.case
|
||||
// - src/function-forms/expr-named/gen-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (named generator function expression in non-strict mode code)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
features: [generators]
|
||||
flags: [generated, noStrict]
|
||||
info: |
|
||||
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function * BindingIdentifier() {
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.sameValue(ref().next().value, ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,23 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body.case
|
||||
// - src/function-forms/expr-named/gen-func-expr-named-no-strict.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (named generator function expression in non-strict mode code)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
features: [generators]
|
||||
flags: [generated, noStrict]
|
||||
info: |
|
||||
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function * BindingIdentifier() {
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.sameValue(ref().next().value, ref);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,27 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-arrow.case
|
||||
// - src/function-forms/expr-named/gen-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (named generator function expression in strict mode code)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
features: [generators]
|
||||
flags: [generated, onlyStrict]
|
||||
info: |
|
||||
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function * BindingIdentifier() {
|
||||
callCount++;
|
||||
(() => {
|
||||
BindingIdentifier = 1;
|
||||
})();
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
ref().next();
|
||||
});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,25 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body-in-eval.case
|
||||
// - src/function-forms/expr-named/gen-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (named generator function expression in strict mode code)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
features: [generators]
|
||||
flags: [generated, onlyStrict]
|
||||
info: |
|
||||
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function * BindingIdentifier() {
|
||||
callCount++;
|
||||
eval("BindingIdentifier = 1");
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
ref().next();
|
||||
});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,25 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/function-forms/reassign-fn-name-in-body.case
|
||||
// - src/function-forms/expr-named/gen-func-expr-named-strict-error.template
|
||||
/*---
|
||||
description: Reassignment of function name is silently ignored in non-strict mode code. (named generator function expression in strict mode code)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
features: [generators]
|
||||
flags: [generated, onlyStrict]
|
||||
info: |
|
||||
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
---*/
|
||||
|
||||
// increment callCount in case "body"
|
||||
let callCount = 0;
|
||||
let ref = function * BindingIdentifier() {
|
||||
callCount++;
|
||||
BindingIdentifier = 1;
|
||||
return BindingIdentifier;
|
||||
};
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
ref().next();
|
||||
});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
Loading…
Reference in New Issue