allow any function to report its toString as a NativeFunction

related: https://github.com/tc39/Function-prototype-toString-revision/pull/26
This commit is contained in:
Michael Ficarra 2018-03-06 18:18:00 -08:00 committed by Rick Waldron
parent ce9419779f
commit 83ffb4bbf2
54 changed files with 180 additions and 116 deletions

View File

@ -6,3 +6,17 @@ description: |
the NativeFunction grammar production without requiring a correct tokeniser. the NativeFunction grammar production without requiring a correct tokeniser.
---*/ ---*/
const NATIVE_FUNCTION_RE = /\bfunction\b[\s\S]*\([\s\S]*\)[\s\S]*\{[\s\S]*\[[\s\S]*\bnative\b[\s\S]+\bcode\b[\s\S]*\][\s\S]*\}/; const NATIVE_FUNCTION_RE = /\bfunction\b[\s\S]*\([\s\S]*\)[\s\S]*\{[\s\S]*\[[\s\S]*\bnative\b[\s\S]+\bcode\b[\s\S]*\][\s\S]*\}/;
const assertToStringOrNativeFunction = function(fn, expected) {
const actual = "" + fn;
try {
assert.sameValue(actual, expected);
} catch (unused) {
assertNativeFunction(fn);
}
};
const assertNativeFunction = function(fn) {
const actual = "" + fn;
assert(NATIVE_FUNCTION_RE.test(actual), "looks pretty much like a NativeFunction");
};

View File

@ -8,8 +8,9 @@ description: >
Function.prototype.toString on an async function created with the Function.prototype.toString on an async function created with the
AsyncFunction constructor. AsyncFunction constructor.
features: [async-functions] features: [async-functions]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
async function f() {} async function f() {}
var AsyncFunction = f.constructor; var AsyncFunction = f.constructor;
var g = /* before */AsyncFunction("a", " /* a */ b, c /* b */ //", "/* c */ ; /* d */ //")/* after */; 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}");

View File

@ -7,10 +7,11 @@ description: >
Function.prototype.toString on an async generator created with the Function.prototype.toString on an async generator created with the
AsyncGenerator constructor. AsyncGenerator constructor.
features: [async-iteration] features: [async-iteration]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
async function* f() {} async function* f() {}
var AsyncGenerator = f.constructor; var AsyncGenerator = f.constructor;
var g = /* before */AsyncGenerator("a", " /* a */ b, c /* b */ //", "/* c */ ; /* d */ //")/* after */; 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}");

View File

@ -4,8 +4,9 @@
/*--- /*---
esid: sec-createdynamicfunction esid: sec-createdynamicfunction
description: Function.prototype.toString on a function created with the Function constructor 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 */; 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}");

View File

@ -5,9 +5,10 @@
esid: sec-createdynamicfunction esid: sec-createdynamicfunction
description: Function.prototype.toString on a generator function created with the GeneratorFunction constructor description: Function.prototype.toString on a generator function created with the GeneratorFunction constructor
features: [generators] features: [generators]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let GeneratorFunction = Object.getPrototypeOf(function*(){}).constructor; let GeneratorFunction = Object.getPrototypeOf(function*(){}).constructor;
let g = /* before */GeneratorFunction("a", " /* a */ b, c /* b */ //", "/* c */ yield yield; /* d */ //")/* after */; 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}");

View File

@ -4,12 +4,13 @@
/*--- /*---
esid: sec-arrow-function-definitions-runtime-semantics-evaluation esid: sec-arrow-function-definitions-runtime-semantics-evaluation
description: Function.prototype.toString on an arrow function 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 f = /* before */( /* a */ a /* b */ , /* c */ b /* d */ ) /* e */ => /* f */ { /* g */ ; /* h */ }/* after */;
let g = /* before */( /* a */ ) /* b */ => /* c */ 0/* after */; let g = /* before */( /* a */ ) /* b */ => /* c */ 0/* after */;
let h = /* before */a /* a */ => /* b */ 0/* after */; let h = /* before */a /* a */ => /* b */ 0/* after */;
assert.sameValue(f.toString(), "( /* a */ a /* b */ , /* c */ b /* d */ ) /* e */ => /* f */ { /* g */ ; /* h */ }"); assertToStringOrNativeFunction(f, "( /* a */ a /* b */ , /* c */ b /* d */ ) /* e */ => /* f */ { /* g */ ; /* h */ }");
assert.sameValue(g.toString(), "( /* a */ ) /* b */ => /* c */ 0"); assertToStringOrNativeFunction(g, "( /* a */ ) /* b */ => /* c */ 0");
assert.sameValue(h.toString(), "a /* a */ => /* b */ 0"); assertToStringOrNativeFunction(h, "a /* a */ => /* b */ 0");

View File

@ -5,12 +5,13 @@
esid: sec-async-arrow-function-definitions-runtime-semantics-evaluation esid: sec-async-arrow-function-definitions-runtime-semantics-evaluation
description: Function.prototype.toString on an async arrow function description: Function.prototype.toString on an async arrow function
features: [async-functions] features: [async-functions]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let f = /* before */async /* a */ ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ }/* after */; 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 g = /* before */async /* a */ ( /* b */ ) /* c */ => /* d */ 0/* after */;
let h = /* before */async /* a */ a /* b */ => /* c */ 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 */ }"); assertToStringOrNativeFunction(f, "async /* a */ ( /* b */ a /* c */ , /* d */ b /* e */ ) /* f */ => /* g */ { /* h */ ; /* i */ }");
assert.sameValue(g.toString(), "async /* a */ ( /* b */ ) /* c */ => /* d */ 0"); assertToStringOrNativeFunction(g, "async /* a */ ( /* b */ ) /* c */ => /* d */ 0");
assert.sameValue(h.toString(), "async /* a */ a /* b */ => /* c */ 0"); assertToStringOrNativeFunction(h, "async /* a */ a /* b */ => /* c */ 0");

View File

@ -6,8 +6,9 @@ author: Brian Terlson <brian.terlson@microsoft.com>
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async function declaration description: Function.prototype.toString on an async function declaration
features: [async-functions] features: [async-functions]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
/* before */async function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }/* after */ /* 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 */ }");

View File

@ -6,10 +6,11 @@ author: Brian Terlson <brian.terlson@microsoft.com>
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async function expression description: Function.prototype.toString on an async function expression
features: [async-functions] 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 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 */; 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 */ }"); assertToStringOrNativeFunction(f, "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(g, "async function /* a */ ( /* b */ x /* c */ , /* d */ y /* e */ ) /* f */ { /* g */ ; /* h */ ; /* i */ }");

View File

@ -5,8 +5,9 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async generator declaration description: Function.prototype.toString on an async generator declaration
features: [async-iteration] 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 */ /* 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 */ }");

View File

@ -5,10 +5,11 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async generator expression description: Function.prototype.toString on an async generator expression
features: [async-iteration] 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 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 */; 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 */ }"); assertToStringOrNativeFunction(f, "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(g, "async /* a */ function /* b */ * /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async generator method description: Function.prototype.toString on an async generator method
features: [async-iteration] features: [async-iteration]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async generator method description: Function.prototype.toString on an async generator method
features: [async-iteration] features: [async-iteration]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async generator method description: Function.prototype.toString on an async generator method
features: [async-iteration] features: [async-iteration]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -16,6 +17,6 @@ let f = F.f;
let g = G.g; let g = G.g;
let h = H.h; let h = H.h;
assert.sameValue(f.toString(), "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async generator method description: Function.prototype.toString on an async generator method
features: [async-iteration] features: [async-iteration]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -16,6 +17,6 @@ let f = F.prototype.f;
let g = G.prototype.g; let g = G.prototype.g;
let h = H.prototype.h; let h = H.prototype.h;
assert.sameValue(f.toString(), "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async generator method description: Function.prototype.toString on an async generator method
features: [async-iteration] features: [async-iteration]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "async /* a */ * /* b */ [ /* c */ \"g\" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async method description: Function.prototype.toString on an async method
features: [async-functions] features: [async-functions]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async method description: Function.prototype.toString on an async method
features: [async-functions] features: [async-functions]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async method description: Function.prototype.toString on an async method
features: [async-functions] features: [async-functions]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -16,6 +17,6 @@ let f = F.f;
let g = G.g; let g = G.g;
let h = H.h; let h = H.h;
assert.sameValue(f.toString(), "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -5,6 +5,7 @@
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async method description: Function.prototype.toString on an async method
features: [async-functions] features: [async-functions]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -16,6 +17,6 @@ let f = F.prototype.f;
let g = G.prototype.g; let g = G.prototype.g;
let h = H.prototype.h; let h = H.prototype.h;
assert.sameValue(f.toString(), "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -6,6 +6,7 @@ author: Brian Terlson <brian.terlson@microsoft.com>
esid: sec-function.prototype.tostring esid: sec-function.prototype.tostring
description: Function.prototype.toString on an async method description: Function.prototype.toString on an async method
features: [async-functions] features: [async-functions]
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; let h = { /* before */async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.h;
assert.sameValue(f.toString(), "async f /* a */ ( /* b */ ) /* c */ { /* d */ }"); assertToStringOrNativeFunction(f, "async f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "async /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -9,4 +9,4 @@ includes: [nativeFunctionMatcher.js]
let f = function(){}.bind(null); let f = function(){}.bind(null);
assert(NATIVE_FUNCTION_RE.test("" + f), "looks pretty much like a NativeFunction"); assertNativeFunction(f);

View File

@ -4,8 +4,9 @@
/*--- /*---
esid: sec-runtime-semantics-bindingclassdeclarationevaluation esid: sec-runtime-semantics-bindingclassdeclarationevaluation
description: Function.prototype.toString on a class declaration (with complex heritage) 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 */ /* 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 */ }");

View File

@ -4,10 +4,11 @@
/*--- /*---
esid: sec-runtime-semantics-bindingclassdeclarationevaluation esid: sec-runtime-semantics-bindingclassdeclarationevaluation
description: Function.prototype.toString on a class declaration (explicit constructor) 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 */ /* 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(){} function B(){}

View File

@ -4,12 +4,13 @@
/*--- /*---
esid: sec-runtime-semantics-bindingclassdeclarationevaluation esid: sec-runtime-semantics-bindingclassdeclarationevaluation
description: Function.prototype.toString on a class declaration (implicit constructor) description: Function.prototype.toString on a class declaration (implicit constructor)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
/* before */class /* a */ A /* b */ { /* c */ }/* after */ /* before */class /* a */ A /* b */ { /* c */ }/* after */
/* before */class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }/* 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 */ /* 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 */ }"); assertToStringOrNativeFunction(A, "class /* a */ A /* b */ { /* c */ }");
assert.sameValue(B.toString(), "class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }"); assertToStringOrNativeFunction(B, "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(C, "class /* a */ C /* b */ extends /* c */ B /* d */ { /* e */ m /* f */ ( /* g */ ) /* h */ { /* i */ } /* j */ }");

View File

@ -4,10 +4,11 @@
/*--- /*---
esid: sec-class-definitions-runtime-semantics-evaluation esid: sec-class-definitions-runtime-semantics-evaluation
description: Function.prototype.toString on a class expression (explicit constructor) 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 */; 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(){} function B(){}

View File

@ -4,12 +4,13 @@
/*--- /*---
esid: sec-class-definitions-runtime-semantics-evaluation esid: sec-class-definitions-runtime-semantics-evaluation
description: Function.prototype.toString on a class expression (implicit constructor) description: Function.prototype.toString on a class expression (implicit constructor)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let A = /* before */class /* a */ A /* b */ { /* c */ }/* after */; let A = /* before */class /* a */ A /* b */ { /* c */ }/* after */;
let B = /* before */class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }/* 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 */; 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 */ }"); assertToStringOrNativeFunction(A, "class /* a */ A /* b */ { /* c */ }");
assert.sameValue(B.toString(), "class /* a */ B /* b */ extends /* c */ A /* d */ { /* e */ }"); assertToStringOrNativeFunction(B, "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(C, "class /* a */ C /* b */ extends /* c */ B /* d */ { /* e */ m /* f */ ( /* g */ ) /* h */ { /* i */ } /* j */ }");

View File

@ -4,8 +4,9 @@
/*--- /*---
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
description: Function.prototype.toString on a function with a non-simple parameter list 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 */ /* 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 */ }");

View File

@ -4,8 +4,9 @@
/*--- /*---
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
description: Function.prototype.toString on a function declaration 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 */ /* 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 */ }");

View File

@ -4,10 +4,11 @@
/*--- /*---
esid: sec-function-definitions-runtime-semantics-evaluation esid: sec-function-definitions-runtime-semantics-evaluation
description: Function.prototype.toString on a function expression 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 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 */; 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 */ }"); assertToStringOrNativeFunction(f, "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(g, "function /* a */ ( /* b */ x /* c */ , /* d */ y /* e */ ) /* f */ { /* g */ ; /* h */ ; /* i */ }");

View File

@ -4,8 +4,9 @@
/*--- /*---
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
description: Function.prototype.toString on a generator function declaration 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 */ /* 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 */ }");

View File

@ -4,10 +4,11 @@
/*--- /*---
esid: sec-generator-function-definitions-runtime-semantics-evaluation esid: sec-generator-function-definitions-runtime-semantics-evaluation
description: Function.prototype.toString on a generator function expression 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 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 */ 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 */ }"); assertToStringOrNativeFunction(f, "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(g, "function /* a */ * /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a generator method description: Function.prototype.toString on a generator method
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; let h = { /* before */* /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }.h;
assert.sameValue(f.toString(), "* /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); assertToStringOrNativeFunction(f, "* /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }");
assert.sameValue(g.toString(), "* /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "* /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "* /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "* /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a getter (class; static) description: Function.prototype.toString on a getter (class; static)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }");
assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a getter (class) description: Function.prototype.toString on a getter (class)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }");
assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a getter (class; static) description: Function.prototype.toString on a getter (class; static)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -15,6 +16,6 @@ let f = Object.getOwnPropertyDescriptor(F, "f").get;
let g = Object.getOwnPropertyDescriptor(G, "g").get; let g = Object.getOwnPropertyDescriptor(G, "g").get;
let h = Object.getOwnPropertyDescriptor(H, "h").get; let h = Object.getOwnPropertyDescriptor(H, "h").get;
assert.sameValue(f.toString(), "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }");
assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a getter (class) description: Function.prototype.toString on a getter (class)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -15,6 +16,6 @@ let f = Object.getOwnPropertyDescriptor(F.prototype, "f").get;
let g = Object.getOwnPropertyDescriptor(G.prototype, "g").get; let g = Object.getOwnPropertyDescriptor(G.prototype, "g").get;
let h = Object.getOwnPropertyDescriptor(H.prototype, "h").get; let h = Object.getOwnPropertyDescriptor(H.prototype, "h").get;
assert.sameValue(f.toString(), "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }"); assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }");
assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a getter (object) description: Function.prototype.toString on a getter (object)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }");
assert.sameValue(g.toString(), "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(g, "get /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");
assert.sameValue(h.toString(), "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }"); assertToStringOrNativeFunction(h, "get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }");

View File

@ -20,5 +20,5 @@ for (let intrinsicName in intrinsics) {
let str = Function.prototype.toString.call(intrinsic); let str = Function.prototype.toString.call(intrinsic);
assert.sameValue(typeof str, "string"); assert.sameValue(typeof str, "string");
assert(RegExp('\\b' + intrinsicName + '\\b').test(str), "contains its name"); assert(RegExp('\\b' + intrinsicName + '\\b').test(str), "contains its name");
assert(NATIVE_FUNCTION_RE.test(str), "looks pretty much like a NativeFunction"); assertNativeFunction(intrinsic);
} }

View File

@ -7,6 +7,7 @@ description: Function.prototype.toString line terminator normalisation (CR-LF)
info: | info: |
Function.prototype.toString should not normalise line terminator sequences to Line Feed characters. Function.prototype.toString should not normalise line terminator sequences to Line Feed characters.
This file uses (Carriage Return, Line Feed) sequences as line terminators. This file uses (Carriage Return, Line Feed) sequences as line terminators.
includes: [nativeFunctionMatcher.js]
---*/ ---*/
// before // before
@ -33,4 +34,4 @@ y
} }
// after // 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}");

View File

@ -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}");

View File

@ -7,6 +7,7 @@ description: Function.prototype.toString line terminator normalisation (LF)
info: | info: |
Function.prototype.toString should not normalise line terminator sequences to Line Feed characters. Function.prototype.toString should not normalise line terminator sequences to Line Feed characters.
This file uses Line Feed characters as line terminators. This file uses Line Feed characters as line terminators.
includes: [nativeFunctionMatcher.js]
---*/ ---*/
// before // before
@ -33,4 +34,4 @@ y
} }
// after // 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}");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-runtime-semantics-definemethod esid: sec-runtime-semantics-definemethod
description: Function.prototype.toString on a method (class; static) description: Function.prototype.toString on a method (class; static)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; let h = class { static /* before */[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.h;
assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(g, "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(h.toString(), "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(h, "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-runtime-semantics-definemethod esid: sec-runtime-semantics-definemethod
description: Function.prototype.toString on a method (class) description: Function.prototype.toString on a method (class)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; let h = class { /* before */[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.prototype.h;
assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(g, "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(h.toString(), "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(h, "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-runtime-semantics-definemethod esid: sec-runtime-semantics-definemethod
description: Function.prototype.toString on a method (class; static) description: Function.prototype.toString on a method (class; static)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -15,6 +16,6 @@ let f = F.f;
let g = G.g; let g = G.g;
let h = H.h; let h = H.h;
assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(g, "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(h.toString(), "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(h, "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-runtime-semantics-definemethod esid: sec-runtime-semantics-definemethod
description: Function.prototype.toString on a method (class) description: Function.prototype.toString on a method (class)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -15,6 +16,6 @@ let f = F.prototype.f;
let g = G.prototype.g; let g = G.prototype.g;
let h = H.prototype.h; let h = H.prototype.h;
assert.sameValue(f.toString(), "f /* a */ ( /* b */ ) /* c */ { /* d */ }"); assertToStringOrNativeFunction(f, "f /* a */ ( /* b */ ) /* c */ { /* d */ }");
assert.sameValue(g.toString(), "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(g, "[ /* a */ \"g\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue(h.toString(), "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(h, "[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");

View File

@ -4,10 +4,11 @@
/*--- /*---
esid: sec-runtime-semantics-definemethod esid: sec-runtime-semantics-definemethod
description: Function.prototype.toString on a method (object) description: Function.prototype.toString on a method (object)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let f = { /* before */[ /* a */ "f" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.f; let f = { /* before */[ /* a */ "f" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.f;
let g = { [ { a(){} }.a ](){ } }["a(){}"]; let g = { [ { a(){} }.a ](){ } }["a(){}"];
assert.sameValue(f.toString(), "[ /* a */ \"f\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(f, "[ /* a */ \"f\" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }");
assert.sameValue("" + g, "[ { a(){} }.a ](){ }"); assertToStringOrNativeFunction(g, "[ { a(){} }.a ](){ }");

View File

@ -4,8 +4,9 @@
/*--- /*---
esid: sec-runtime-semantics-definemethod esid: sec-runtime-semantics-definemethod
description: Function.prototype.toString on a method (object) description: Function.prototype.toString on a method (object)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let f = { /* before */f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }.f; 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 */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a setter (class; static) description: Function.prototype.toString on a setter (class; static)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a setter (class) description: Function.prototype.toString on a setter (class)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a setter (class; static) description: Function.prototype.toString on a setter (class; static)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -15,6 +16,6 @@ let f = Object.getOwnPropertyDescriptor(F, "f").set;
let g = Object.getOwnPropertyDescriptor(G, "g").set; let g = Object.getOwnPropertyDescriptor(G, "g").set;
let h = Object.getOwnPropertyDescriptor(H, "h").set; let h = Object.getOwnPropertyDescriptor(H, "h").set;
assert.sameValue(f.toString(), "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a setter (class) description: Function.prototype.toString on a setter (class)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; let x = "h";
@ -15,6 +16,6 @@ let f = Object.getOwnPropertyDescriptor(F.prototype, "f").set;
let g = Object.getOwnPropertyDescriptor(G.prototype, "g").set; let g = Object.getOwnPropertyDescriptor(G.prototype, "g").set;
let h = Object.getOwnPropertyDescriptor(H.prototype, "h").set; let h = Object.getOwnPropertyDescriptor(H.prototype, "h").set;
assert.sameValue(f.toString(), "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }"); assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }");

View File

@ -4,6 +4,7 @@
/*--- /*---
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
description: Function.prototype.toString on a setter (object) description: Function.prototype.toString on a setter (object)
includes: [nativeFunctionMatcher.js]
---*/ ---*/
let x = "h"; 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 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; 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 */ }"); assertToStringOrNativeFunction(f, "set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }");
assert.sameValue(g.toString(), "set /* a */ [ /* b */ \"g\" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }"); assertToStringOrNativeFunction(g, "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(h, "set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }");

View File

@ -7,8 +7,9 @@ description: Function.prototype.toString on a function with Unicode escape seque
info: | info: |
Function.prototype.toString returns a slice of the source text before Function.prototype.toString returns a slice of the source text before
any potential Unicode escape sequence substitution in identifiers any potential Unicode escape sequence substitution in identifiers
includes: [nativeFunctionMatcher.js]
---*/ ---*/
function \u0061(\u{62}, \u0063) { \u0062 = \u{00063}; return b; } 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; }");