Generate tests

This commit is contained in:
Rick Waldron 2020-09-25 11:23:33 -04:00
parent 1a1b1770e8
commit 5090f7adfe
100 changed files with 186 additions and 96 deletions

View File

@ -16,7 +16,7 @@ var callCount = 0;
var f; var f;
f = () => { f = () => {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -16,7 +16,7 @@ var callCount = 0;
var f; var f;
f = () => { f = () => {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -21,7 +21,7 @@ var f;
f = () => { f = () => {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -24,7 +24,7 @@ var callCount = 0;
var f; var f;
f = async () => { f = async () => {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
}; };
f() f()

View File

@ -24,7 +24,7 @@ var callCount = 0;
var f; var f;
f = async () => { f = async () => {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
}; };
f() f()

View File

@ -29,7 +29,7 @@ var f;
f = async () => { f = async () => {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
}; };
f() f()

View File

@ -19,7 +19,7 @@ info: |
var callCount = 0; var callCount = 0;
var f = async function f() { var f = async function f() {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -19,7 +19,7 @@ info: |
var callCount = 0; var callCount = 0;
var f = async function f() { var f = async function f() {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -19,7 +19,7 @@ info: |
var callCount = 0; var callCount = 0;
var f = async function() { var f = async function() {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -19,7 +19,7 @@ info: |
var callCount = 0; var callCount = 0;
var f = async function() { var f = async function() {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -24,7 +24,7 @@ var callCount = 0;
var f = async function f() { var f = async function f() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -24,7 +24,7 @@ var callCount = 0;
var f = async function() { var f = async function() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -20,7 +20,7 @@ var callCount = 0;
var f; var f;
f = async function*() { f = async function*() {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
}; };
f().next() f().next()

View File

@ -20,7 +20,7 @@ var callCount = 0;
var f; var f;
f = async function*() { f = async function*() {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
}; };
f().next() f().next()

View File

@ -20,7 +20,7 @@ var callCount = 0;
var f; var f;
f = async function* g() { f = async function* g() {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
}; };
f().next() f().next()

View File

@ -20,7 +20,7 @@ var callCount = 0;
var f; var f;
f = async function* g() { f = async function* g() {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
}; };
f().next() f().next()

View File

@ -25,7 +25,7 @@ var f;
f = async function*() { f = async function*() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
}; };
f().next() f().next()

View File

@ -25,7 +25,7 @@ var f;
f = async function* g() { f = async function* g() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
}; };
f().next() f().next()

View File

@ -18,7 +18,7 @@ var callCount = 0;
var C = class { var C = class {
static async *method() { static async *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -18,7 +18,7 @@ var callCount = 0;
var C = class { var C = class {
static async *method() { static async *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -23,7 +23,7 @@ var C = class {
static async *method() { static async *method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -18,7 +18,7 @@ var callCount = 0;
var C = class { var C = class {
async *method() { async *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -18,7 +18,7 @@ var callCount = 0;
var C = class { var C = class {
async *method() { async *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -23,7 +23,7 @@ var C = class {
async *method() { async *method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -20,7 +20,7 @@ var callCount = 0;
var C = class { var C = class {
static async method() { static async method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -20,7 +20,7 @@ var callCount = 0;
var C = class { var C = class {
static async method() { static async method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -25,7 +25,7 @@ var C = class {
static async method() { static async method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -19,7 +19,7 @@ var callCount = 0;
var C = class { var C = class {
async method() { async method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -19,7 +19,7 @@ var callCount = 0;
var C = class { var C = class {
async method() { async method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -24,7 +24,7 @@ var C = class {
async method() { async method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -18,7 +18,7 @@ var callCount = 0;
var C = class { var C = class {
static *method() { static *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -18,7 +18,7 @@ var callCount = 0;
var C = class { var C = class {
static *method() { static *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -23,7 +23,7 @@ var C = class {
static *method() { static *method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -18,7 +18,7 @@ var callCount = 0;
var C = class { var C = class {
*method() { *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -18,7 +18,7 @@ var callCount = 0;
var C = class { var C = class {
*method() { *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -23,7 +23,7 @@ var C = class {
*method() { *method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -16,7 +16,7 @@ var callCount = 0;
var C = class { var C = class {
static method() { static method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -16,7 +16,7 @@ var callCount = 0;
var C = class { var C = class {
static method() { static method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -21,7 +21,7 @@ var C = class {
static method() { static method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -16,7 +16,7 @@ var callCount = 0;
var C = class { var C = class {
method() { method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -16,7 +16,7 @@ var callCount = 0;
var C = class { var C = class {
method() { method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -21,7 +21,7 @@ var C = class {
method() { method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -0,0 +1,23 @@
// This file was procedurally generated from the following sources:
// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
// - src/function-forms/forbidden-extensions/bullet-one/func-expr.template
/*---
description: Forbidden extension, o.arguments (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated, noStrict]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
ECMAScript function objects defined using syntactic constructors in strict mode code must not be created with own properties named "caller" or "arguments". Such own properties also must not be created for function objects defined using an ArrowFunction, MethodDefinition, GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression, ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or AsyncArrowFunction regardless of whether the definition is contained in strict mode code. Built-in functions, strict functions created using the Function constructor, generator functions created using the Generator constructor, async functions created using the AsyncFunction constructor, and functions created using the bind method also must not be created with such own properties.
---*/
var callCount = 0;
var f;
f = function() {
f.arguments;
callCount++;
};
f();
assert.sameValue(callCount, 1, 'function was evaluated');

View File

@ -0,0 +1,23 @@
// This file was procedurally generated from the following sources:
// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
// - src/function-forms/forbidden-extensions/bullet-one/func-expr.template
/*---
description: Forbidden extension, o.caller (function expression)
esid: sec-function-definitions-runtime-semantics-evaluation
flags: [generated, noStrict]
info: |
FunctionExpression : function ( FormalParameters ) { FunctionBody }
ECMAScript function objects defined using syntactic constructors in strict mode code must not be created with own properties named "caller" or "arguments". Such own properties also must not be created for function objects defined using an ArrowFunction, MethodDefinition, GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression, ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or AsyncArrowFunction regardless of whether the definition is contained in strict mode code. Built-in functions, strict functions created using the Function constructor, generator functions created using the Generator constructor, async functions created using the AsyncFunction constructor, and functions created using the bind method also must not be created with such own properties.
---*/
var callCount = 0;
var f;
f = function() {
f.caller;
callCount++;
};
f();
assert.sameValue(callCount, 1, 'function was evaluated');

View File

@ -17,7 +17,7 @@ var f;
f = function() { f = function() {
"use strict"; "use strict";
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f(); f();

View File

@ -17,7 +17,7 @@ var f;
f = function() { f = function() {
"use strict"; "use strict";
f.caller; f.caller;
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f(); f();

View File

@ -21,7 +21,7 @@ var f;
f = function() { f = function() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f(); f();

View File

@ -18,7 +18,7 @@ var callCount = 0;
var f; var f;
f = function*() { f = function*() {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -18,7 +18,7 @@ var callCount = 0;
var f; var f;
f = function*() { f = function*() {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -23,7 +23,7 @@ var f;
f = function*() { f = function*() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
}; };
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -20,7 +20,7 @@ var callCount = 0;
var obj = { var obj = {
async *method() { async *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -20,7 +20,7 @@ var callCount = 0;
var obj = { var obj = {
async *method() { async *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -21,7 +21,7 @@ var callCount = 0;
var obj = { var obj = {
async method() { async method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -21,7 +21,7 @@ var callCount = 0;
var obj = { var obj = {
async method() { async method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -19,7 +19,7 @@ var callCount = 0;
var obj = { var obj = {
*method() { *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -19,7 +19,7 @@ var callCount = 0;
var obj = { var obj = {
*method() { *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -16,7 +16,7 @@ var callCount = 0;
var obj = { var obj = {
method() { method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -16,7 +16,7 @@ var callCount = 0;
var obj = { var obj = {
method() { method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -25,7 +25,7 @@ var obj = {
async *method() { async *method() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -26,7 +26,7 @@ var obj = {
async method() { async method() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -24,7 +24,7 @@ var obj = {
*method() { *method() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -21,7 +21,7 @@ var obj = {
method() { method() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
}; };

View File

@ -19,7 +19,7 @@ info: |
var callCount = 0; var callCount = 0;
async function f() { async function f() {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -19,7 +19,7 @@ info: |
var callCount = 0; var callCount = 0;
async function f() { async function f() {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -24,7 +24,7 @@ var callCount = 0;
async function f() { async function f() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
f() f()

View File

@ -19,7 +19,7 @@ info: |
var callCount = 0; var callCount = 0;
async function* f() { async function* f() {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
} }
f().next() f().next()

View File

@ -19,7 +19,7 @@ info: |
var callCount = 0; var callCount = 0;
async function* f() { async function* f() {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
} }
f().next() f().next()

View File

@ -24,7 +24,7 @@ var callCount = 0;
async function* f() { async function* f() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
f().next() f().next()

View File

@ -19,7 +19,7 @@ var callCount = 0;
class C { class C {
static async *method() { static async *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -19,7 +19,7 @@ var callCount = 0;
class C { class C {
static async *method() { static async *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -24,7 +24,7 @@ class C {
static async *method() { static async *method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -18,7 +18,7 @@ var callCount = 0;
class C { class C {
async *method() { async *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -18,7 +18,7 @@ var callCount = 0;
class C { class C {
async *method() { async *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -23,7 +23,7 @@ class C {
async *method() { async *method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -19,7 +19,7 @@ var callCount = 0;
class C { class C {
static async method() { static async method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -19,7 +19,7 @@ var callCount = 0;
class C { class C {
static async method() { static async method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -24,7 +24,7 @@ class C {
static async method() { static async method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -19,7 +19,7 @@ var callCount = 0;
class C { class C {
async method() { async method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -19,7 +19,7 @@ var callCount = 0;
class C { class C {
async method() { async method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -24,7 +24,7 @@ class C {
async method() { async method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -18,7 +18,7 @@ var callCount = 0;
class C { class C {
static *method() { static *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -18,7 +18,7 @@ var callCount = 0;
class C { class C {
static *method() { static *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -23,7 +23,7 @@ class C {
static *method() { static *method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -18,7 +18,7 @@ var callCount = 0;
class C { class C {
*method() { *method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -18,7 +18,7 @@ var callCount = 0;
class C { class C {
*method() { *method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -23,7 +23,7 @@ class C {
*method() { *method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -16,7 +16,7 @@ var callCount = 0;
class C { class C {
static method() { static method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -16,7 +16,7 @@ var callCount = 0;
class C { class C {
static method() { static method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -21,7 +21,7 @@ class C {
static method() { static method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -16,7 +16,7 @@ var callCount = 0;
class C { class C {
method() { method() {
this.method.arguments; this.method.arguments;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -16,7 +16,7 @@ var callCount = 0;
class C { class C {
method() { method() {
this.method.caller; this.method.caller;
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -21,7 +21,7 @@ class C {
method() { method() {
/* implicit strict */ /* implicit strict */
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
} }

View File

@ -17,7 +17,7 @@ var callCount = 0;
function f() { function f() {
"use strict"; "use strict";
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f(); f();

View File

@ -17,7 +17,7 @@ var callCount = 0;
function f() { function f() {
"use strict"; "use strict";
f.caller; f.caller;
callCount = callCount + 1; callCount++;
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f(); f();

View File

@ -0,0 +1,22 @@
// This file was procedurally generated from the following sources:
// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
// - src/function-forms/forbidden-extensions/bullet-one/func-decl.template
/*---
description: Forbidden extension, o.arguments (function declaration)
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
flags: [generated, noStrict]
info: |
FunctionDeclaration :
function BindingIdentifier ( FormalParameters ) { FunctionBody }
ECMAScript function objects defined using syntactic constructors in strict mode code must not be created with own properties named "caller" or "arguments". Such own properties also must not be created for function objects defined using an ArrowFunction, MethodDefinition, GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression, ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or AsyncArrowFunction regardless of whether the definition is contained in strict mode code. Built-in functions, strict functions created using the Function constructor, generator functions created using the Generator constructor, async functions created using the AsyncFunction constructor, and functions created using the bind method also must not be created with such own properties.
---*/
var callCount = 0;
function f() {
f.arguments;
callCount++;
}
f();
assert.sameValue(callCount, 1, 'function was evaluated');

View File

@ -0,0 +1,22 @@
// This file was procedurally generated from the following sources:
// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
// - src/function-forms/forbidden-extensions/bullet-one/func-decl.template
/*---
description: Forbidden extension, o.caller (function declaration)
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
flags: [generated, noStrict]
info: |
FunctionDeclaration :
function BindingIdentifier ( FormalParameters ) { FunctionBody }
ECMAScript function objects defined using syntactic constructors in strict mode code must not be created with own properties named "caller" or "arguments". Such own properties also must not be created for function objects defined using an ArrowFunction, MethodDefinition, GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression, ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or AsyncArrowFunction regardless of whether the definition is contained in strict mode code. Built-in functions, strict functions created using the Function constructor, generator functions created using the Generator constructor, async functions created using the AsyncFunction constructor, and functions created using the bind method also must not be created with such own properties.
---*/
var callCount = 0;
function f() {
f.caller;
callCount++;
}
f();
assert.sameValue(callCount, 1, 'function was evaluated');

View File

@ -21,7 +21,7 @@ var callCount = 0;
function f() { function f() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
f(); f();

View File

@ -17,7 +17,7 @@ info: |
var callCount = 0; var callCount = 0;
function* f() { function* f() {
f.arguments; f.arguments;
callCount = callCount + 1; callCount++;
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -17,7 +17,7 @@ info: |
var callCount = 0; var callCount = 0;
function* f() { function* f() {
f.caller; f.caller;
callCount = callCount + 1; callCount++;
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {

View File

@ -22,7 +22,7 @@ var callCount = 0;
function* f() { function* f() {
"use strict"; "use strict";
inner().toString(); inner().toString();
callCount = callCount + 1; callCount++;
} }
assert.throws(TypeError, function() { assert.throws(TypeError, function() {