diff options
author | Michael Ficarra <mficarra@shapesecurity.com> | 2018-03-06 18:18:00 -0800 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2018-03-07 14:09:45 -0500 |
commit | 83ffb4bbf2a7a2f68075c8e611525b55ea5cfecc (patch) | |
tree | b5592940e641b3b0e2b1c38dfe53eee2b9fcdacc /test/built-ins/Function | |
parent | ce9419779fc61d5cdfa37a5cda7b6828c67221da (diff) | |
download | qtdeclarative-testsuites-83ffb4bbf2a7a2f68075c8e611525b55ea5cfecc.tar.gz |
allow any function to report its toString as a NativeFunction
related: https://github.com/tc39/Function-prototype-toString-revision/pull/26
Diffstat (limited to 'test/built-ins/Function')
53 files changed, 166 insertions, 116 deletions
diff --git a/test/built-ins/Function/prototype/toString/AsyncFunction.js b/test/built-ins/Function/prototype/toString/AsyncFunction.js index 23af1aa49..3a8148fdf 100644 --- a/test/built-ins/Function/prototype/toString/AsyncFunction.js +++ b/test/built-ins/Function/prototype/toString/AsyncFunction.js @@ -8,8 +8,9 @@ description: > Function.prototype.toString on an async function created with the AsyncFunction constructor. features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ async function f() {} var AsyncFunction = f.constructor; var g = /* before */AsyncFunction("a", " /* a */ b, c /* b */ //", "/* c */ ; /* d */ //")/* after */; -assert.sameValue(g.toString(), "async function anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ ; /* d */ //\n}"); +assertToStringOrNativeFunction(g, "async function anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ ; /* d */ //\n}"); diff --git a/test/built-ins/Function/prototype/toString/AsyncGenerator.js b/test/built-ins/Function/prototype/toString/AsyncGenerator.js index f5acf5761..47a857a7d 100644 --- a/test/built-ins/Function/prototype/toString/AsyncGenerator.js +++ b/test/built-ins/Function/prototype/toString/AsyncGenerator.js @@ -7,10 +7,11 @@ description: > Function.prototype.toString on an async generator created with the AsyncGenerator constructor. features: [async-iteration] +includes: [nativeFunctionMatcher.js] ---*/ async function* f() {} var AsyncGenerator = f.constructor; var g = /* before */AsyncGenerator("a", " /* a */ b, c /* b */ //", "/* c */ ; /* d */ //")/* after */; -assert.sameValue(g.toString(), "async function* anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ ; /* d */ //\n}"); +assertToStringOrNativeFunction(g, "async function* anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ ; /* d */ //\n}"); diff --git a/test/built-ins/Function/prototype/toString/Function.js b/test/built-ins/Function/prototype/toString/Function.js index 2f0362a8d..a619787cc 100644 --- a/test/built-ins/Function/prototype/toString/Function.js +++ b/test/built-ins/Function/prototype/toString/Function.js @@ -4,8 +4,9 @@ /*--- esid: sec-createdynamicfunction description: Function.prototype.toString on a function created with the Function constructor +includes: [nativeFunctionMatcher.js] ---*/ let f = /* before */Function("a", " /* a */ b, c /* b */ //", "/* c */ ; /* d */ //")/* after */; -assert.sameValue(f.toString(), "function anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ ; /* d */ //\n}"); +assertToStringOrNativeFunction(f, "function anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ ; /* d */ //\n}"); diff --git a/test/built-ins/Function/prototype/toString/GeneratorFunction.js b/test/built-ins/Function/prototype/toString/GeneratorFunction.js index 523f1cd2a..83e54b98a 100644 --- a/test/built-ins/Function/prototype/toString/GeneratorFunction.js +++ b/test/built-ins/Function/prototype/toString/GeneratorFunction.js @@ -5,9 +5,10 @@ esid: sec-createdynamicfunction description: Function.prototype.toString on a generator function created with the GeneratorFunction constructor features: [generators] +includes: [nativeFunctionMatcher.js] ---*/ let GeneratorFunction = Object.getPrototypeOf(function*(){}).constructor; let g = /* before */GeneratorFunction("a", " /* a */ b, c /* b */ //", "/* c */ yield yield; /* d */ //")/* after */; -assert.sameValue(g.toString(), "function* anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ yield yield; /* d */ //\n}"); +assertToStringOrNativeFunction(g, "function* anonymous(a, /* a */ b, c /* b */ //\n) {\n/* c */ yield yield; /* d */ //\n}"); diff --git a/test/built-ins/Function/prototype/toString/arrow-function.js b/test/built-ins/Function/prototype/toString/arrow-function.js index 06990b14c..897ea45b2 100644 --- a/test/built-ins/Function/prototype/toString/arrow-function.js +++ b/test/built-ins/Function/prototype/toString/arrow-function.js @@ -4,12 +4,13 @@ /*--- esid: sec-arrow-function-definitions-runtime-semantics-evaluation description: Function.prototype.toString on an arrow function +includes: [nativeFunctionMatcher.js] ---*/ let f = /* before */( /* a */ a /* b */ , /* c */ b /* d */ ) /* e */ => /* f */ { /* g */ ; /* h */ }/* after */; let g = /* before */( /* a */ ) /* b */ => /* c */ 0/* after */; let h = /* before */a /* a */ => /* b */ 0/* after */; -assert.sameValue(f.toString(), "( /* a */ a /* b */ , /* c */ b /* d */ ) /* e */ => /* f */ { /* g */ ; /* h */ }"); -assert.sameValue(g.toString(), "( /* a */ ) /* b */ => /* c */ 0"); -assert.sameValue(h.toString(), "a /* a */ => /* b */ 0"); +assertToStringOrNativeFunction(f, "( /* a */ a /* b */ , /* c */ b /* d */ ) /* e */ => /* f */ { /* g */ ; /* h */ }"); +assertToStringOrNativeFunction(g, "( /* a */ ) /* b */ => /* c */ 0"); +assertToStringOrNativeFunction(h, "a /* a */ => /* b */ 0"); diff --git a/test/built-ins/Function/prototype/toString/async-arrow-function.js b/test/built-ins/Function/prototype/toString/async-arrow-function.js index 39a2a0388..ee534f0b6 100644 --- a/test/built-ins/Function/prototype/toString/async-arrow-function.js +++ b/test/built-ins/Function/prototype/toString/async-arrow-function.js @@ -5,12 +5,13 @@ esid: sec-async-arrow-function-definitions-runtime-semantics-evaluation description: Function.prototype.toString on an async arrow function features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ let f = /* before */async /* a */ ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ }/* after */; let g = /* before */async /* a */ ( /* b */ ) /* c */ => /* d */ 0/* after */; let h = /* before */async /* a */ a /* b */ => /* c */ 0/* after */; -assert.sameValue(f.toString(), "async /* a */ ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ }"); -assert.sameValue(g.toString(), "async /* a */ ( /* b */ ) /* c */ => /* d */ 0"); -assert.sameValue(h.toString(), "async /* a */ a /* b */ => /* c */ 0"); +assertToStringOrNativeFunction(f, "async /* a */ ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ }"); +assertToStringOrNativeFunction(g, "async /* a */ ( /* b */ ) /* c */ => /* d */ 0"); +assertToStringOrNativeFunction(h, "async /* a */ a /* b */ => /* c */ 0"); diff --git a/test/built-ins/Function/prototype/toString/async-function-declaration.js b/test/built-ins/Function/prototype/toString/async-function-declaration.js index 0bc6c5500..168efa012 100644 --- a/test/built-ins/Function/prototype/toString/async-function-declaration.js +++ b/test/built-ins/Function/prototype/toString/async-function-declaration.js @@ -6,8 +6,9 @@ author: Brian Terlson <brian.terlson@microsoft.com> esid: sec-function.prototype.tostring description: Function.prototype.toString on an async function declaration features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ /* before */async function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }/* after */ -assert.sameValue(f.toString(), "async function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); +assertToStringOrNativeFunction(f, "async function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-function-expression.js b/test/built-ins/Function/prototype/toString/async-function-expression.js index 2b540b4e8..d9878ea5d 100644 --- a/test/built-ins/Function/prototype/toString/async-function-expression.js +++ b/test/built-ins/Function/prototype/toString/async-function-expression.js @@ -6,10 +6,11 @@ author: Brian Terlson <brian.terlson@microsoft.com> esid: sec-function.prototype.tostring description: Function.prototype.toString on an async function expression features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ let f = /* before */async function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }/* after */; let g = /* before */async function /* a */ ( /* b */ x /* c */ , /* d */ y /* e */ ) /* f */ { /* g */ ; /* h */ ; /* i */ }/* after */; -assert.sameValue(f.toString(), "async function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); -assert.sameValue(g.toString(), "async function /* a */ ( /* b */ x /* c */ , /* d */ y /* e */ ) /* f */ { /* g */ ; /* h */ ; /* i */ }"); +assertToStringOrNativeFunction(f, "async function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); +assertToStringOrNativeFunction(g, "async function /* a */ ( /* b */ x /* c */ , /* d */ y /* e */ ) /* f */ { /* g */ ; /* h */ ; /* i */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-generator-declaration.js b/test/built-ins/Function/prototype/toString/async-generator-declaration.js index 49374185e..ffb583cb5 100644 --- a/test/built-ins/Function/prototype/toString/async-generator-declaration.js +++ b/test/built-ins/Function/prototype/toString/async-generator-declaration.js @@ -5,8 +5,9 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async generator declaration features: [async-iteration] +includes: [nativeFunctionMatcher.js] ---*/ /* before */async /* a */ function /* b */ * /* c */ f /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }/* after */ -assert.sameValue(f.toString(), "async /* a */ function /* b */ * /* c */ f /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }"); +assertToStringOrNativeFunction(f, "async /* a */ function /* b */ * /* c */ f /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-generator-expression.js b/test/built-ins/Function/prototype/toString/async-generator-expression.js index f7c3bdf93..6b8ed2613 100644 --- a/test/built-ins/Function/prototype/toString/async-generator-expression.js +++ b/test/built-ins/Function/prototype/toString/async-generator-expression.js @@ -5,10 +5,11 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async generator expression features: [async-iteration] +includes: [nativeFunctionMatcher.js] ---*/ let f = /* before */async /* a */ function /* b */ * /* c */ F /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }/* after */; let g = /* before */async /* a */ function /* b */ * /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }/* after */; -assert.sameValue(f.toString(), "async /* a */ function /* b */ * /* c */ F /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }"); -assert.sameValue(g.toString(), "async /* a */ function /* b */ * /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }"); +assertToStringOrNativeFunction(f, "async /* a */ function /* b */ * /* c */ F /* d */ ( /* e */ x /* f */ , /* g */ y /* h */ ) /* i */ { /* j */ ; /* k */ ; /* l */ }"); +assertToStringOrNativeFunction(g, "async /* a */ function /* b */ * /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-generator-method-class-expression-static.js b/test/built-ins/Function/prototype/toString/async-generator-method-class-expression-static.js index 27f90e29d..16428b38f 100644 --- a/test/built-ins/Function/prototype/toString/async-generator-method-class-expression-static.js +++ b/test/built-ins/Function/prototype/toString/async-generator-method-class-expression-static.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async generator method features: [async-iteration] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -12,6 +13,6 @@ let f = class { static /* before */async /* a */ * /* b */ f /* c */ ( /* d */ ) let g = class { static /* before */async /* a */ * /* b */ [ /* c */ "g" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }.g; let h = class { static /* before */async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }.h; -assert.sameValue(f.toString(), "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-generator-method-class-expression.js b/test/built-ins/Function/prototype/toString/async-generator-method-class-expression.js index fae7a4ee7..e9b00710f 100644 --- a/test/built-ins/Function/prototype/toString/async-generator-method-class-expression.js +++ b/test/built-ins/Function/prototype/toString/async-generator-method-class-expression.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async generator method features: [async-iteration] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -12,6 +13,6 @@ let f = class { /* before */async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e * let g = class { /* before */async /* a */ * /* b */ [ /* c */ "g" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }.prototype.g; let h = class { /* before */async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }.prototype.h; -assert.sameValue(f.toString(), "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-generator-method-class-statement-static.js b/test/built-ins/Function/prototype/toString/async-generator-method-class-statement-static.js index 5a4294c18..8ada3fe1e 100644 --- a/test/built-ins/Function/prototype/toString/async-generator-method-class-statement-static.js +++ b/test/built-ins/Function/prototype/toString/async-generator-method-class-statement-static.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async generator method features: [async-iteration] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -16,6 +17,6 @@ let f = F.f; let g = G.g; let h = H.h; -assert.sameValue(f.toString(), "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-generator-method-class-statement.js b/test/built-ins/Function/prototype/toString/async-generator-method-class-statement.js index 8160bd4dd..0ee3ffc0e 100644 --- a/test/built-ins/Function/prototype/toString/async-generator-method-class-statement.js +++ b/test/built-ins/Function/prototype/toString/async-generator-method-class-statement.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async generator method features: [async-iteration] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -16,6 +17,6 @@ let f = F.prototype.f; let g = G.prototype.g; let h = H.prototype.h; -assert.sameValue(f.toString(), "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-generator-method-object.js b/test/built-ins/Function/prototype/toString/async-generator-method-object.js index ef8fbb9e4..826538b87 100644 --- a/test/built-ins/Function/prototype/toString/async-generator-method-object.js +++ b/test/built-ins/Function/prototype/toString/async-generator-method-object.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async generator method features: [async-iteration] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -12,6 +13,6 @@ let f = { /* before */async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* let g = { /* before */async /* a */ * /* b */ [ /* c */ "g" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }.g; let h = { /* before */async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }.h; -assert.sameValue(f.toString(), "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-method-class-expression-static.js b/test/built-ins/Function/prototype/toString/async-method-class-expression-static.js index c3604bbef..ba319409f 100644 --- a/test/built-ins/Function/prototype/toString/async-method-class-expression-static.js +++ b/test/built-ins/Function/prototype/toString/async-method-class-expression-static.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async method features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -12,6 +13,6 @@ let f = class { static /* before */async f /* a */ ( /* b */ ) /* c */ { /* d */ let g = class { static /* before */async /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.g; let h = class { static /* before */async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.h; -assert.sameValue(f.toString(), "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-method-class-expression.js b/test/built-ins/Function/prototype/toString/async-method-class-expression.js index be19ef930..17511ca84 100644 --- a/test/built-ins/Function/prototype/toString/async-method-class-expression.js +++ b/test/built-ins/Function/prototype/toString/async-method-class-expression.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async method features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -12,6 +13,6 @@ let f = class { /* before */async f /* a */ ( /* b */ ) /* c */ { /* d */ }/* af let g = class { /* before */async /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.prototype.g; let h = class { /* before */async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.prototype.h; -assert.sameValue(f.toString(), "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-method-class-statement-static.js b/test/built-ins/Function/prototype/toString/async-method-class-statement-static.js index d20bf935c..50f4c9ac2 100644 --- a/test/built-ins/Function/prototype/toString/async-method-class-statement-static.js +++ b/test/built-ins/Function/prototype/toString/async-method-class-statement-static.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async method features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -16,6 +17,6 @@ let f = F.f; let g = G.g; let h = H.h; -assert.sameValue(f.toString(), "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-method-class-statement.js b/test/built-ins/Function/prototype/toString/async-method-class-statement.js index d80ac9e62..acca01424 100644 --- a/test/built-ins/Function/prototype/toString/async-method-class-statement.js +++ b/test/built-ins/Function/prototype/toString/async-method-class-statement.js @@ -5,6 +5,7 @@ esid: sec-function.prototype.tostring description: Function.prototype.toString on an async method features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -16,6 +17,6 @@ let f = F.prototype.f; let g = G.prototype.g; let h = H.prototype.h; -assert.sameValue(f.toString(), "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/async-method-object.js b/test/built-ins/Function/prototype/toString/async-method-object.js index 9f4c673b4..36f2ab333 100644 --- a/test/built-ins/Function/prototype/toString/async-method-object.js +++ b/test/built-ins/Function/prototype/toString/async-method-object.js @@ -6,6 +6,7 @@ author: Brian Terlson <brian.terlson@microsoft.com> esid: sec-function.prototype.tostring description: Function.prototype.toString on an async method features: [async-functions] +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -13,6 +14,6 @@ let f = { /* before */async f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ let g = { /* before */async /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.g; let h = { /* before */async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.h; -assert.sameValue(f.toString(), "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/bound-function.js b/test/built-ins/Function/prototype/toString/bound-function.js index b6ceb116e..20881fb71 100644 --- a/test/built-ins/Function/prototype/toString/bound-function.js +++ b/test/built-ins/Function/prototype/toString/bound-function.js @@ -9,4 +9,4 @@ includes: [nativeFunctionMatcher.js] let f = function(){}.bind(null); -assert(NATIVE_FUNCTION_RE.test("" + f), "looks pretty much like a NativeFunction"); +assertNativeFunction(f); diff --git a/test/built-ins/Function/prototype/toString/class-declaration-complex-heritage.js b/test/built-ins/Function/prototype/toString/class-declaration-complex-heritage.js index dbf60ee83..96482e821 100644 --- a/test/built-ins/Function/prototype/toString/class-declaration-complex-heritage.js +++ b/test/built-ins/Function/prototype/toString/class-declaration-complex-heritage.js @@ -4,8 +4,9 @@ /*--- esid: sec-runtime-semantics-bindingclassdeclarationevaluation description: Function.prototype.toString on a class declaration (with complex heritage) +includes: [nativeFunctionMatcher.js] ---*/ /* before */class /* a */ A /* b */ extends /* c */ class /* d */ B /* e */ { /* f */ } /* g */ { /* h */ }/* after */ -assert.sameValue(A.toString(), "class /* a */ A /* b */ extends /* c */ class /* d */ B /* e */ { /* f */ } /* g */ { /* h */ }"); +assertToStringOrNativeFunction(A, "class /* a */ A /* b */ extends /* c */ class /* d */ B /* e */ { /* f */ } /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/class-declaration-explicit-ctor.js b/test/built-ins/Function/prototype/toString/class-declaration-explicit-ctor.js index c3b4b264f..edcc0608f 100644 --- a/test/built-ins/Function/prototype/toString/class-declaration-explicit-ctor.js +++ b/test/built-ins/Function/prototype/toString/class-declaration-explicit-ctor.js @@ -4,10 +4,11 @@ /*--- esid: sec-runtime-semantics-bindingclassdeclarationevaluation description: Function.prototype.toString on a class declaration (explicit constructor) +includes: [nativeFunctionMatcher.js] ---*/ /* before */class /* a */ A /* b */ extends /* c */ B /* d */ { /* e */ constructor /* f */ ( /* g */ ) /* h */ { /* i */ ; /* j */ } /* k */ m /* l */ ( /* m */ ) /* n */ { /* o */ } /* p */ }/* after */ -assert.sameValue(A.toString(), "class /* a */ A /* b */ extends /* c */ B /* d */ { /* e */ constructor /* f */ ( /* g */ ) /* h */ { /* i */ ; /* j */ } /* k */ m /* l */ ( /* m */ ) /* n */ { /* o */ } /* p */ }"); +assertToStringOrNativeFunction(A, "class /* a */ A /* b */ extends /* c */ B /* d */ { /* e */ constructor /* f */ ( /* g */ ) /* h */ { /* i */ ; /* j */ } /* k */ m /* l */ ( /* m */ ) /* n */ { /* o */ } /* p */ }"); function B(){} diff --git a/test/built-ins/Function/prototype/toString/class-declaration-implicit-ctor.js b/test/built-ins/Function/prototype/toString/class-declaration-implicit-ctor.js index 9dea84bb6..3f8ab82f7 100644 --- a/test/built-ins/Function/prototype/toString/class-declaration-implicit-ctor.js +++ b/test/built-ins/Function/prototype/toString/class-declaration-implicit-ctor.js @@ -4,12 +4,13 @@ /*--- esid: sec-runtime-semantics-bindingclassdeclarationevaluation description: Function.prototype.toString on a class declaration (implicit constructor) +includes: [nativeFunctionMatcher.js] ---*/ /* before */class /* a */ A /* b */ { /* c */ }/* after */ /* before */class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }/* after */ /* before */class /* a */ C /* b */ extends /* c */ B /* d */ { /* e */ m /* f */ ( /* g */ ) /* h */ { /* i */ } /* j */ }/* after */ -assert.sameValue(A.toString(), "class /* a */ A /* b */ { /* c */ }"); -assert.sameValue(B.toString(), "class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }"); -assert.sameValue(C.toString(), "class /* a */ C /* b */ extends /* c */ B /* d */ { /* e */ m /* f */ ( /* g */ ) /* h */ { /* i */ } /* j */ }"); +assertToStringOrNativeFunction(A, "class /* a */ A /* b */ { /* c */ }"); +assertToStringOrNativeFunction(B, "class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }"); +assertToStringOrNativeFunction(C, "class /* a */ C /* b */ extends /* c */ B /* d */ { /* e */ m /* f */ ( /* g */ ) /* h */ { /* i */ } /* j */ }"); diff --git a/test/built-ins/Function/prototype/toString/class-expression-explicit-ctor.js b/test/built-ins/Function/prototype/toString/class-expression-explicit-ctor.js index 93d744847..de838da08 100644 --- a/test/built-ins/Function/prototype/toString/class-expression-explicit-ctor.js +++ b/test/built-ins/Function/prototype/toString/class-expression-explicit-ctor.js @@ -4,10 +4,11 @@ /*--- esid: sec-class-definitions-runtime-semantics-evaluation description: Function.prototype.toString on a class expression (explicit constructor) +includes: [nativeFunctionMatcher.js] ---*/ let A = /* before */class /* a */ A /* b */ extends /* c */ B /* d */ { /* e */ constructor /* f */ ( /* g */ ) /* h */ { /* i */ ; /* j */ } /* k */ m /* l */ ( /* m */ ) /* n */ { /* o */ } /* p */ }/* after */; -assert.sameValue(A.toString(), "class /* a */ A /* b */ extends /* c */ B /* d */ { /* e */ constructor /* f */ ( /* g */ ) /* h */ { /* i */ ; /* j */ } /* k */ m /* l */ ( /* m */ ) /* n */ { /* o */ } /* p */ }"); +assertToStringOrNativeFunction(A, "class /* a */ A /* b */ extends /* c */ B /* d */ { /* e */ constructor /* f */ ( /* g */ ) /* h */ { /* i */ ; /* j */ } /* k */ m /* l */ ( /* m */ ) /* n */ { /* o */ } /* p */ }"); function B(){} diff --git a/test/built-ins/Function/prototype/toString/class-expression-implicit-ctor.js b/test/built-ins/Function/prototype/toString/class-expression-implicit-ctor.js index 91ab62134..91ce1b593 100644 --- a/test/built-ins/Function/prototype/toString/class-expression-implicit-ctor.js +++ b/test/built-ins/Function/prototype/toString/class-expression-implicit-ctor.js @@ -4,12 +4,13 @@ /*--- esid: sec-class-definitions-runtime-semantics-evaluation description: Function.prototype.toString on a class expression (implicit constructor) +includes: [nativeFunctionMatcher.js] ---*/ let A = /* before */class /* a */ A /* b */ { /* c */ }/* after */; let B = /* before */class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }/* after */; let C = /* before */class /* a */ C /* b */ extends /* c */ B /* d */ { /* e */ m /* f */ ( /* g */ ) /* h */ { /* i */ } /* j */ }/* after */; -assert.sameValue(A.toString(), "class /* a */ A /* b */ { /* c */ }"); -assert.sameValue(B.toString(), "class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }"); -assert.sameValue(C.toString(), "class /* a */ C /* b */ extends /* c */ B /* d */ { /* e */ m /* f */ ( /* g */ ) /* h */ { /* i */ } /* j */ }"); +assertToStringOrNativeFunction(A, "class /* a */ A /* b */ { /* c */ }"); +assertToStringOrNativeFunction(B, "class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }"); +assertToStringOrNativeFunction(C, "class /* a */ C /* b */ extends /* c */ B /* d */ { /* e */ m /* f */ ( /* g */ ) /* h */ { /* i */ } /* j */ }"); diff --git a/test/built-ins/Function/prototype/toString/function-declaration-non-simple-parameter-list.js b/test/built-ins/Function/prototype/toString/function-declaration-non-simple-parameter-list.js index 7ff7971e0..1b86a9842 100644 --- a/test/built-ins/Function/prototype/toString/function-declaration-non-simple-parameter-list.js +++ b/test/built-ins/Function/prototype/toString/function-declaration-non-simple-parameter-list.js @@ -4,8 +4,9 @@ /*--- esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject description: Function.prototype.toString on a function with a non-simple parameter list +includes: [nativeFunctionMatcher.js] ---*/ /* before */function /* a */ f /* b */ ( /* c */ a /* d */ = /* e */ 0 /* f */ , /* g */ { /* h */ b /* i */ = /* j */ 0 /* k */ } /* l */ ) /* m */ { /* n */ }/* after */ -assert.sameValue(f.toString(), "function /* a */ f /* b */ ( /* c */ a /* d */ = /* e */ 0 /* f */ , /* g */ { /* h */ b /* i */ = /* j */ 0 /* k */ } /* l */ ) /* m */ { /* n */ }"); +assertToStringOrNativeFunction(f, "function /* a */ f /* b */ ( /* c */ a /* d */ = /* e */ 0 /* f */ , /* g */ { /* h */ b /* i */ = /* j */ 0 /* k */ } /* l */ ) /* m */ { /* n */ }"); diff --git a/test/built-ins/Function/prototype/toString/function-declaration.js b/test/built-ins/Function/prototype/toString/function-declaration.js index a0446ba71..c96032910 100644 --- a/test/built-ins/Function/prototype/toString/function-declaration.js +++ b/test/built-ins/Function/prototype/toString/function-declaration.js @@ -4,8 +4,9 @@ /*--- esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject description: Function.prototype.toString on a function declaration +includes: [nativeFunctionMatcher.js] ---*/ /* before */function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }/* after */ -assert.sameValue(f.toString(), "function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); +assertToStringOrNativeFunction(f, "function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); diff --git a/test/built-ins/Function/prototype/toString/function-expression.js b/test/built-ins/Function/prototype/toString/function-expression.js index b1bcedaf4..251d06c7f 100644 --- a/test/built-ins/Function/prototype/toString/function-expression.js +++ b/test/built-ins/Function/prototype/toString/function-expression.js @@ -4,10 +4,11 @@ /*--- esid: sec-function-definitions-runtime-semantics-evaluation description: Function.prototype.toString on a function expression +includes: [nativeFunctionMatcher.js] ---*/ let f = /* before */function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }/* after */; let g = /* before */function /* a */ ( /* b */ x /* c */ , /* d */ y /* e */ ) /* f */ { /* g */ ; /* h */ ; /* i */ }/* after */; -assert.sameValue(f.toString(), "function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); -assert.sameValue(g.toString(), "function /* a */ ( /* b */ x /* c */ , /* d */ y /* e */ ) /* f */ { /* g */ ; /* h */ ; /* i */ }"); +assertToStringOrNativeFunction(f, "function /* a */ F /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); +assertToStringOrNativeFunction(g, "function /* a */ ( /* b */ x /* c */ , /* d */ y /* e */ ) /* f */ { /* g */ ; /* h */ ; /* i */ }"); diff --git a/test/built-ins/Function/prototype/toString/generator-function-declaration.js b/test/built-ins/Function/prototype/toString/generator-function-declaration.js index 133f9af8c..5ba2dd25b 100644 --- a/test/built-ins/Function/prototype/toString/generator-function-declaration.js +++ b/test/built-ins/Function/prototype/toString/generator-function-declaration.js @@ -4,8 +4,9 @@ /*--- esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject description: Function.prototype.toString on a generator function declaration +includes: [nativeFunctionMatcher.js] ---*/ /* before */function /* a */ * /* b */ g /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }/* after */ -assert.sameValue(g.toString(), "function /* a */ * /* b */ g /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }"); +assertToStringOrNativeFunction(g, "function /* a */ * /* b */ g /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }"); diff --git a/test/built-ins/Function/prototype/toString/generator-function-expression.js b/test/built-ins/Function/prototype/toString/generator-function-expression.js index d175055ec..054562e00 100644 --- a/test/built-ins/Function/prototype/toString/generator-function-expression.js +++ b/test/built-ins/Function/prototype/toString/generator-function-expression.js @@ -4,10 +4,11 @@ /*--- esid: sec-generator-function-definitions-runtime-semantics-evaluation description: Function.prototype.toString on a generator function expression +includes: [nativeFunctionMatcher.js] ---*/ let f = /* before */function /* a */ * /* b */ F /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }/* after */ let g = /* before */function /* a */ * /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }/* after */ -assert.sameValue(f.toString(), "function /* a */ * /* b */ F /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }"); -assert.sameValue(g.toString(), "function /* a */ * /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); +assertToStringOrNativeFunction(f, "function /* a */ * /* b */ F /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }"); +assertToStringOrNativeFunction(g, "function /* a */ * /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }"); diff --git a/test/built-ins/Function/prototype/toString/generator-method.js b/test/built-ins/Function/prototype/toString/generator-method.js index f5cb5d218..a4cf16ef6 100644 --- a/test/built-ins/Function/prototype/toString/generator-method.js +++ b/test/built-ins/Function/prototype/toString/generator-method.js @@ -4,6 +4,7 @@ /*--- esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a generator method +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = { /* before */* /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }/* afte let g = { /* before */* /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.g; let h = { /* before */* /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.h; -assert.sameValue(f.toString(), "* /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); -assert.sameValue(g.toString(), "* /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "* /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "* /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); +assertToStringOrNativeFunction(g, "* /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "* /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/getter-class-expression-static.js b/test/built-ins/Function/prototype/toString/getter-class-expression-static.js index 009d92127..d646abae3 100644 --- a/test/built-ins/Function/prototype/toString/getter-class-expression-static.js +++ b/test/built-ins/Function/prototype/toString/getter-class-expression-static.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a getter (class; static) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = Object.getOwnPropertyDescriptor(class { static /* before */get /* a */ f let g = Object.getOwnPropertyDescriptor(class { static /* before */get /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }, "g").get; let h = Object.getOwnPropertyDescriptor(class { static /* before */get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }, "h").get; -assert.sameValue(f.toString(), "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); -assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); +assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/getter-class-expression.js b/test/built-ins/Function/prototype/toString/getter-class-expression.js index 7b3eef410..923a257e9 100644 --- a/test/built-ins/Function/prototype/toString/getter-class-expression.js +++ b/test/built-ins/Function/prototype/toString/getter-class-expression.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a getter (class) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = Object.getOwnPropertyDescriptor(class { /* before */get /* a */ f /* b * let g = Object.getOwnPropertyDescriptor(class { /* before */get /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.prototype, "g").get; let h = Object.getOwnPropertyDescriptor(class { /* before */get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.prototype, "h").get; -assert.sameValue(f.toString(), "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); -assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); +assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/getter-class-statement-static.js b/test/built-ins/Function/prototype/toString/getter-class-statement-static.js index 4ac72bccd..350634b10 100644 --- a/test/built-ins/Function/prototype/toString/getter-class-statement-static.js +++ b/test/built-ins/Function/prototype/toString/getter-class-statement-static.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a getter (class; static) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -15,6 +16,6 @@ let f = Object.getOwnPropertyDescriptor(F, "f").get; let g = Object.getOwnPropertyDescriptor(G, "g").get; let h = Object.getOwnPropertyDescriptor(H, "h").get; -assert.sameValue(f.toString(), "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); -assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); +assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/getter-class-statement.js b/test/built-ins/Function/prototype/toString/getter-class-statement.js index 83139c33c..4da490a25 100644 --- a/test/built-ins/Function/prototype/toString/getter-class-statement.js +++ b/test/built-ins/Function/prototype/toString/getter-class-statement.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a getter (class) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -15,6 +16,6 @@ let f = Object.getOwnPropertyDescriptor(F.prototype, "f").get; let g = Object.getOwnPropertyDescriptor(G.prototype, "g").get; let h = Object.getOwnPropertyDescriptor(H.prototype, "h").get; -assert.sameValue(f.toString(), "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); -assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); +assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/getter-object.js b/test/built-ins/Function/prototype/toString/getter-object.js index 3e794d04b..801da03a9 100644 --- a/test/built-ins/Function/prototype/toString/getter-object.js +++ b/test/built-ins/Function/prototype/toString/getter-object.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a getter (object) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = Object.getOwnPropertyDescriptor({ /* before */get /* a */ f /* b */ ( /* let g = Object.getOwnPropertyDescriptor({ /* before */get /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }, "g").get; let h = Object.getOwnPropertyDescriptor({ /* before */get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }, "h").get; -assert.sameValue(f.toString(), "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); -assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); -assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); +assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); +assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); diff --git a/test/built-ins/Function/prototype/toString/intrinsics.js b/test/built-ins/Function/prototype/toString/intrinsics.js index dc1319596..7cb08d4ba 100644 --- a/test/built-ins/Function/prototype/toString/intrinsics.js +++ b/test/built-ins/Function/prototype/toString/intrinsics.js @@ -20,5 +20,5 @@ for (let intrinsicName in intrinsics) { let str = Function.prototype.toString.call(intrinsic); assert.sameValue(typeof str, "string"); assert(RegExp('\\b' + intrinsicName + '\\b').test(str), "contains its name"); - assert(NATIVE_FUNCTION_RE.test(str), "looks pretty much like a NativeFunction"); + assertNativeFunction(intrinsic); } diff --git a/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR-LF.js b/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR-LF.js index 93f653936..a7b438e2e 100644 --- a/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR-LF.js +++ b/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR-LF.js @@ -7,6 +7,7 @@ description: Function.prototype.toString line terminator normalisation (CR-LF) info: |
Function.prototype.toString should not normalise line terminator sequences to Line Feed characters.
This file uses (Carriage Return, Line Feed) sequences as line terminators.
+includes: [nativeFunctionMatcher.js]
---*/
// before
@@ -33,4 +34,4 @@ y }
// after
-assert.sameValue(f.toString(), "function\r\n// a\r\nf\r\n// b\r\n(\r\n// c\r\nx\r\n// d\r\n,\r\n// e\r\ny\r\n// f\r\n)\r\n// g\r\n{\r\n// h\r\n;\r\n// i\r\n;\r\n// j\r\n}");
+assertToStringOrNativeFunction(f, "function\r\n// a\r\nf\r\n// b\r\n(\r\n// c\r\nx\r\n// d\r\n,\r\n// e\r\ny\r\n// f\r\n)\r\n// g\r\n{\r\n// h\r\n;\r\n// i\r\n;\r\n// j\r\n}");
diff --git a/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js b/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js index 4e55706f6..402c0b80f 100644 --- a/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js +++ b/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js @@ -1 +1 @@ -// Copyright (C) 2016 Michael Ficarra. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
description: Function.prototype.toString line terminator normalisation (CR)
info: |
Function.prototype.toString should not normalise line terminator sequences to Line Feed characters.
This file uses Carriage Return characters as line terminators.
---*/
// before
function
// a
f
// b
(
// c
x
// d
,
// e
y
// f
)
// g
{
// h
;
// i
;
// j
}
// after
assert.sameValue(f.toString(), "function\r// a\rf\r// b\r(\r// c\rx\r// d\r,\r// e\ry\r// f\r)\r// g\r{\r// h\r;\r// i\r;\r// j\r}");
+// Copyright (C) 2016 Michael Ficarra. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
description: Function.prototype.toString line terminator normalisation (CR)
info: |
Function.prototype.toString should not normalise line terminator sequences to Line Feed characters.
This file uses Carriage Return characters as line terminators.
includes: [nativeFunctionMatcher.js]
---*/
// before
function
// a
f
// b
(
// c
x
// d
,
// e
y
// f
)
// g
{
// h
;
// i
;
// j
}
// after
assertToStringOrNativeFunction(f, "function\r// a\rf\r// b\r(\r// c\rx\r// d\r,\r// e\ry\r// f\r)\r// g\r{\r// h\r;\r// i\r;\r// j\r}");
diff --git a/test/built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js b/test/built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js index 69b785543..ec629a60b 100644 --- a/test/built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js +++ b/test/built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js @@ -7,6 +7,7 @@ description: Function.prototype.toString line terminator normalisation (LF) info: | Function.prototype.toString should not normalise line terminator sequences to Line Feed characters. This file uses Line Feed characters as line terminators. +includes: [nativeFunctionMatcher.js] ---*/ // before @@ -33,4 +34,4 @@ y } // after -assert.sameValue(f.toString(), "function\n// a\nf\n// b\n(\n// c\nx\n// d\n,\n// e\ny\n// f\n)\n// g\n{\n// h\n;\n// i\n;\n// j\n}"); +assertToStringOrNativeFunction(f, "function\n// a\nf\n// b\n(\n// c\nx\n// d\n,\n// e\ny\n// f\n)\n// g\n{\n// h\n;\n// i\n;\n// j\n}"); diff --git a/test/built-ins/Function/prototype/toString/method-class-expression-static.js b/test/built-ins/Function/prototype/toString/method-class-expression-static.js index 9a81f8f10..5abb0862b 100644 --- a/test/built-ins/Function/prototype/toString/method-class-expression-static.js +++ b/test/built-ins/Function/prototype/toString/method-class-expression-static.js @@ -4,6 +4,7 @@ /*--- esid: sec-runtime-semantics-definemethod description: Function.prototype.toString on a method (class; static) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = class { static /* before */f /* a */ ( /* b */ ) /* c */ { /* d */ }/* a let g = class { static /* before */[ /* a */ "g" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.g; let h = class { static /* before */[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.h; -assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(h.toString(), "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(h, "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); diff --git a/test/built-ins/Function/prototype/toString/method-class-expression.js b/test/built-ins/Function/prototype/toString/method-class-expression.js index cdfe9643e..5089dafb6 100644 --- a/test/built-ins/Function/prototype/toString/method-class-expression.js +++ b/test/built-ins/Function/prototype/toString/method-class-expression.js @@ -4,6 +4,7 @@ /*--- esid: sec-runtime-semantics-definemethod description: Function.prototype.toString on a method (class) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = class { /* before */f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ let g = class { /* before */[ /* a */ "g" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.prototype.g; let h = class { /* before */[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.prototype.h; -assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(h.toString(), "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(h, "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); diff --git a/test/built-ins/Function/prototype/toString/method-class-statement-static.js b/test/built-ins/Function/prototype/toString/method-class-statement-static.js index f8e9817a8..67d50f118 100644 --- a/test/built-ins/Function/prototype/toString/method-class-statement-static.js +++ b/test/built-ins/Function/prototype/toString/method-class-statement-static.js @@ -4,6 +4,7 @@ /*--- esid: sec-runtime-semantics-definemethod description: Function.prototype.toString on a method (class; static) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -15,6 +16,6 @@ let f = F.f; let g = G.g; let h = H.h; -assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(h.toString(), "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(h, "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); diff --git a/test/built-ins/Function/prototype/toString/method-class-statement.js b/test/built-ins/Function/prototype/toString/method-class-statement.js index 3ee83d514..f45aa2d0a 100644 --- a/test/built-ins/Function/prototype/toString/method-class-statement.js +++ b/test/built-ins/Function/prototype/toString/method-class-statement.js @@ -4,6 +4,7 @@ /*--- esid: sec-runtime-semantics-definemethod description: Function.prototype.toString on a method (class) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -15,6 +16,6 @@ let f = F.prototype.f; let g = G.prototype.g; let h = H.prototype.h; -assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); -assert.sameValue(g.toString(), "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(h.toString(), "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(g, "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(h, "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); diff --git a/test/built-ins/Function/prototype/toString/method-computed-property-name.js b/test/built-ins/Function/prototype/toString/method-computed-property-name.js index dcf692d23..8b8270909 100644 --- a/test/built-ins/Function/prototype/toString/method-computed-property-name.js +++ b/test/built-ins/Function/prototype/toString/method-computed-property-name.js @@ -4,10 +4,11 @@ /*--- esid: sec-runtime-semantics-definemethod description: Function.prototype.toString on a method (object) +includes: [nativeFunctionMatcher.js] ---*/ let f = { /* before */[ /* a */ "f" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.f; let g = { [ { a(){} }.a ](){ } }["a(){}"]; -assert.sameValue(f.toString(), "[ /* a */ \"f\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); -assert.sameValue("" + g, "[ { a(){} }.a ](){ }"); +assertToStringOrNativeFunction(f, "[ /* a */ \"f\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "[ { a(){} }.a ](){ }"); diff --git a/test/built-ins/Function/prototype/toString/method-object.js b/test/built-ins/Function/prototype/toString/method-object.js index 6930964ed..088eb3ade 100644 --- a/test/built-ins/Function/prototype/toString/method-object.js +++ b/test/built-ins/Function/prototype/toString/method-object.js @@ -4,8 +4,9 @@ /*--- esid: sec-runtime-semantics-definemethod description: Function.prototype.toString on a method (object) +includes: [nativeFunctionMatcher.js] ---*/ let f = { /* before */f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }.f; -assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); +assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); diff --git a/test/built-ins/Function/prototype/toString/setter-class-expression-static.js b/test/built-ins/Function/prototype/toString/setter-class-expression-static.js index ab0b1ede4..51719e589 100644 --- a/test/built-ins/Function/prototype/toString/setter-class-expression-static.js +++ b/test/built-ins/Function/prototype/toString/setter-class-expression-static.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a setter (class; static) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = Object.getOwnPropertyDescriptor(class { static /* before */set /* a */ f let g = Object.getOwnPropertyDescriptor(class { static /* before */set /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }, "g").set; let h = Object.getOwnPropertyDescriptor(class { static /* before */set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }, "h").set; -assert.sameValue(f.toString(), "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/setter-class-expression.js b/test/built-ins/Function/prototype/toString/setter-class-expression.js index b34b4128e..10842e10b 100644 --- a/test/built-ins/Function/prototype/toString/setter-class-expression.js +++ b/test/built-ins/Function/prototype/toString/setter-class-expression.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a setter (class) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = Object.getOwnPropertyDescriptor(class { /* before */set /* a */ f /* b * let g = Object.getOwnPropertyDescriptor(class { /* before */set /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }.prototype, "g").set; let h = Object.getOwnPropertyDescriptor(class { /* before */set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }.prototype, "h").set; -assert.sameValue(f.toString(), "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/setter-class-statement-static.js b/test/built-ins/Function/prototype/toString/setter-class-statement-static.js index 7a5a37de0..16bbf4c56 100644 --- a/test/built-ins/Function/prototype/toString/setter-class-statement-static.js +++ b/test/built-ins/Function/prototype/toString/setter-class-statement-static.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a setter (class; static) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -15,6 +16,6 @@ let f = Object.getOwnPropertyDescriptor(F, "f").set; let g = Object.getOwnPropertyDescriptor(G, "g").set; let h = Object.getOwnPropertyDescriptor(H, "h").set; -assert.sameValue(f.toString(), "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/setter-class-statement.js b/test/built-ins/Function/prototype/toString/setter-class-statement.js index 7c0c2b3e0..366e4b54b 100644 --- a/test/built-ins/Function/prototype/toString/setter-class-statement.js +++ b/test/built-ins/Function/prototype/toString/setter-class-statement.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a setter (class) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -15,6 +16,6 @@ let f = Object.getOwnPropertyDescriptor(F.prototype, "f").set; let g = Object.getOwnPropertyDescriptor(G.prototype, "g").set; let h = Object.getOwnPropertyDescriptor(H.prototype, "h").set; -assert.sameValue(f.toString(), "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/setter-object.js b/test/built-ins/Function/prototype/toString/setter-object.js index 20adbe3e0..08a0f0154 100644 --- a/test/built-ins/Function/prototype/toString/setter-object.js +++ b/test/built-ins/Function/prototype/toString/setter-object.js @@ -4,6 +4,7 @@ /*--- esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation description: Function.prototype.toString on a setter (object) +includes: [nativeFunctionMatcher.js] ---*/ let x = "h"; @@ -11,6 +12,6 @@ let f = Object.getOwnPropertyDescriptor({ /* before */set /* a */ f /* b */ ( /* let g = Object.getOwnPropertyDescriptor({ /* before */set /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }, "g").set; let h = Object.getOwnPropertyDescriptor({ /* before */set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }, "h").set; -assert.sameValue(f.toString(), "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); -assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); -assert.sameValue(h.toString(), "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); +assertToStringOrNativeFunction(g, "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); +assertToStringOrNativeFunction(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); diff --git a/test/built-ins/Function/prototype/toString/unicode.js b/test/built-ins/Function/prototype/toString/unicode.js index fa176fac2..d7addb1cf 100644 --- a/test/built-ins/Function/prototype/toString/unicode.js +++ b/test/built-ins/Function/prototype/toString/unicode.js @@ -7,8 +7,9 @@ description: Function.prototype.toString on a function with Unicode escape seque info: | Function.prototype.toString returns a slice of the source text before any potential Unicode escape sequence substitution in identifiers +includes: [nativeFunctionMatcher.js] ---*/ function \u0061(\u{62}, \u0063) { \u0062 = \u{00063}; return b; } -assert.sameValue(a.toString(), "function \\u0061(\\u{62}, \\u0063) { \\u0062 = \\u{00063}; return b; }"); +assertToStringOrNativeFunction(a, "function \\u0061(\\u{62}, \\u0063) { \\u0062 = \\u{00063}; return b; }"); |