mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Add Function.prototype.toString tests for async generator functions (#955)
* Add Function.prototype.toString tests for many function forms * Add non-const computed property name to Function.prototype.toString tests * Split class method tests into class-expression and class-statement tests * Add tests for unnamed function expression forms * Add tests for async (generator) methods in class contexts * Add test case for Function.prototype.toString on async arrow function
This commit is contained in:
parent
faaa4685e4
commit
da764cafa2
16
test/built-ins/Function/prototype/toString/AsyncGenerator.js
vendored
Normal file
16
test/built-ins/Function/prototype/toString/AsyncGenerator.js
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: >
|
||||
Function.prototype.toString on an async generator created with the
|
||||
AsyncGenerator constructor.
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
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}");
|
16
test/built-ins/Function/prototype/toString/async-arrow-function.js
vendored
Normal file
16
test/built-ins/Function/prototype/toString/async-arrow-function.js
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-async-arrow-function-definitions-runtime-semantics-evaluation
|
||||
description: Function.prototype.toString on an async arrow function
|
||||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
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");
|
@ -8,6 +8,8 @@ description: Function.prototype.toString on an async function expression
|
||||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
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 */;
|
||||
|
||||
assert.sameValue(f.toString(), "async function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }");
|
||||
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 */ }");
|
||||
|
12
test/built-ins/Function/prototype/toString/async-generator-declaration.js
vendored
Normal file
12
test/built-ins/Function/prototype/toString/async-generator-declaration.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async generator declaration
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
/* 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 */ }");
|
14
test/built-ins/Function/prototype/toString/async-generator-expression.js
vendored
Normal file
14
test/built-ins/Function/prototype/toString/async-generator-expression.js
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async generator expression
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
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 */ }");
|
17
test/built-ins/Function/prototype/toString/async-generator-method-class-expression-static.js
vendored
Normal file
17
test/built-ins/Function/prototype/toString/async-generator-method-class-expression-static.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async generator method
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = class { static /* before */async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.f;
|
||||
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 */ }");
|
17
test/built-ins/Function/prototype/toString/async-generator-method-class-expression.js
vendored
Normal file
17
test/built-ins/Function/prototype/toString/async-generator-method-class-expression.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async generator method
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = class { /* before */async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.prototype.f;
|
||||
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 */ }");
|
21
test/built-ins/Function/prototype/toString/async-generator-method-class-statement-static.js
vendored
Normal file
21
test/built-ins/Function/prototype/toString/async-generator-method-class-statement-static.js
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async generator method
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { static /* before */async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }
|
||||
class G { static /* before */async /* a */ * /* b */ [ /* c */ "g" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }
|
||||
class H { static /* before */async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }
|
||||
|
||||
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 */ }");
|
21
test/built-ins/Function/prototype/toString/async-generator-method-class-statement.js
vendored
Normal file
21
test/built-ins/Function/prototype/toString/async-generator-method-class-statement.js
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async generator method
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { /* before */async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }
|
||||
class G { /* before */async /* a */ * /* b */ [ /* c */ "g" /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }
|
||||
class H { /* before */async /* a */ * /* b */ [ /* c */ x /* d */ ] /* e */ ( /* f */ ) /* g */ { /* h */ }/* after */ }
|
||||
|
||||
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 */ }");
|
17
test/built-ins/Function/prototype/toString/async-generator-method-object.js
vendored
Normal file
17
test/built-ins/Function/prototype/toString/async-generator-method-object.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async generator method
|
||||
features: [async-iteration]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = { /* before */async /* a */ * /* b */ f /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }.f;
|
||||
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 */ }");
|
17
test/built-ins/Function/prototype/toString/async-method-class-expression-static.js
vendored
Normal file
17
test/built-ins/Function/prototype/toString/async-method-class-expression-static.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async method
|
||||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = class { static /* before */async f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }.f;
|
||||
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 */ }");
|
17
test/built-ins/Function/prototype/toString/async-method-class-expression.js
vendored
Normal file
17
test/built-ins/Function/prototype/toString/async-method-class-expression.js
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async method
|
||||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = class { /* before */async f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }.prototype.f;
|
||||
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 */ }");
|
21
test/built-ins/Function/prototype/toString/async-method-class-statement-static.js
vendored
Normal file
21
test/built-ins/Function/prototype/toString/async-method-class-statement-static.js
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async method
|
||||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { static /* before */async f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }
|
||||
class G { static /* before */async /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }
|
||||
class H { static /* before */async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }
|
||||
|
||||
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 */ }");
|
21
test/built-ins/Function/prototype/toString/async-method-class-statement.js
vendored
Normal file
21
test/built-ins/Function/prototype/toString/async-method-class-statement.js
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: pending
|
||||
description: Function.prototype.toString on an async method
|
||||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { /* before */async f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }
|
||||
class G { /* before */async /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }
|
||||
class H { /* before */async /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }
|
||||
|
||||
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 */ }");
|
@ -8,8 +8,11 @@ description: Function.prototype.toString on an async method
|
||||
features: [async-functions]
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = { /* before */async f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }.f;
|
||||
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 */ }");
|
@ -6,6 +6,8 @@ esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
description: Function.prototype.toString on a function expression
|
||||
---*/
|
||||
|
||||
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 */;
|
||||
|
||||
assert.sameValue(f.toString(), "function /* a */ f /* b */ ( /* c */ x /* d */ , /* e */ y /* f */ ) /* g */ { /* h */ ; /* i */ ; /* j */ }");
|
||||
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 */ }");
|
||||
|
@ -6,6 +6,8 @@ esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
description: Function.prototype.toString on a generator function expression
|
||||
---*/
|
||||
|
||||
let g = /* before */function /* a */ * /* b */ name /* 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 */
|
||||
|
||||
assert.sameValue(g.toString(), "function /* a */ * /* b */ name /* c */ ( /* d */ x /* e */ , /* f */ y /* g */ ) /* h */ { /* i */ ; /* j */ ; /* k */ }");
|
||||
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 */ }");
|
||||
|
@ -6,8 +6,11 @@ esid: sec-generator-function-definitions-runtime-semantics-propertydefinitioneva
|
||||
description: Function.prototype.toString on a generator method
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = { /* before */* /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }/* after */ }.f;
|
||||
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 */ }");
|
||||
|
@ -6,8 +6,11 @@ esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a getter (class; static)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = Object.getOwnPropertyDescriptor(class { static /* before */get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }/* after */ }, "f").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;
|
||||
|
||||
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 */ }");
|
@ -6,8 +6,11 @@ esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a getter (class)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = Object.getOwnPropertyDescriptor(class { /* before */get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }/* after */ }.prototype, "f").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;
|
||||
|
||||
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 */ }");
|
20
test/built-ins/Function/prototype/toString/getter-class-statement-static.js
vendored
Normal file
20
test/built-ins/Function/prototype/toString/getter-class-statement-static.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2016 Michael Ficarra. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a getter (class; static)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { static /* before */get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }/* after */ }
|
||||
class G { static /* before */get /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }
|
||||
class H { static /* before */get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }
|
||||
|
||||
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 */ }");
|
20
test/built-ins/Function/prototype/toString/getter-class-statement.js
vendored
Normal file
20
test/built-ins/Function/prototype/toString/getter-class-statement.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2016 Michael Ficarra. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a getter (class)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { /* before */get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }/* after */ }
|
||||
class G { /* before */get /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }
|
||||
class H { /* before */get /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ ) /* f */ { /* g */ }/* after */ }
|
||||
|
||||
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 */ }");
|
@ -6,8 +6,11 @@ esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a getter (object)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = Object.getOwnPropertyDescriptor({ /* before */get /* a */ f /* b */ ( /* c */ ) /* d */ { /* e */ }/* after */ }, "f").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;
|
||||
|
||||
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 */ }");
|
||||
|
@ -6,8 +6,11 @@ esid: sec-runtime-semantics-definemethod
|
||||
description: Function.prototype.toString on a method (class; static)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = class { static /* before */f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }.f;
|
||||
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 */ }");
|
@ -6,8 +6,11 @@ esid: sec-runtime-semantics-definemethod
|
||||
description: Function.prototype.toString on a method (class)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = class { /* before */f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }.prototype.f;
|
||||
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 */ }");
|
20
test/built-ins/Function/prototype/toString/method-class-statement-static.js
vendored
Normal file
20
test/built-ins/Function/prototype/toString/method-class-statement-static.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2016 Michael Ficarra. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-runtime-semantics-definemethod
|
||||
description: Function.prototype.toString on a method (class; static)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { static /* before */f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }
|
||||
class G { static /* before */[ /* a */ "g" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }
|
||||
class H { static /* before */[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }
|
||||
|
||||
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 */ }");
|
20
test/built-ins/Function/prototype/toString/method-class-statement.js
vendored
Normal file
20
test/built-ins/Function/prototype/toString/method-class-statement.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2016 Michael Ficarra. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-runtime-semantics-definemethod
|
||||
description: Function.prototype.toString on a method (class)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { /* before */f /* a */ ( /* b */ ) /* c */ { /* d */ }/* after */ }
|
||||
class G { /* before */[ /* a */ "g" /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }
|
||||
class H { /* before */[ /* a */ x /* b */ ] /* c */ ( /* d */ ) /* e */ { /* f */ }/* after */ }
|
||||
|
||||
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 */ }");
|
@ -6,8 +6,11 @@ esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a setter (class; static)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = Object.getOwnPropertyDescriptor(class { static /* before */set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }/* after */ }, "f").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;
|
||||
|
||||
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 */ }");
|
@ -6,8 +6,11 @@ esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a setter (class)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = Object.getOwnPropertyDescriptor(class { /* before */set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }/* after */ }.prototype, "f").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;
|
||||
|
||||
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 */ }");
|
20
test/built-ins/Function/prototype/toString/setter-class-statement-static.js
vendored
Normal file
20
test/built-ins/Function/prototype/toString/setter-class-statement-static.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2016 Michael Ficarra. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a setter (class; static)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { static /* before */set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }/* after */ }
|
||||
class G { static /* before */set /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }
|
||||
class H { static /* before */set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }
|
||||
|
||||
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 */ }");
|
20
test/built-ins/Function/prototype/toString/setter-class-statement.js
vendored
Normal file
20
test/built-ins/Function/prototype/toString/setter-class-statement.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2016 Michael Ficarra. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a setter (class)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
class F { /* before */set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }/* after */ }
|
||||
class G { /* before */set /* a */ [ /* b */ "g" /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }
|
||||
class H { /* before */set /* a */ [ /* b */ x /* c */ ] /* d */ ( /* e */ a /* f */ ) /* g */ { /* h */ }/* after */ }
|
||||
|
||||
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 */ }");
|
@ -6,8 +6,11 @@ esid: sec-method-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
description: Function.prototype.toString on a setter (object)
|
||||
---*/
|
||||
|
||||
let x = "h";
|
||||
let f = Object.getOwnPropertyDescriptor({ /* before */set /* a */ f /* b */ ( /* c */ a /* d */ ) /* e */ { /* f */ }/* after */ }, "f").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;
|
||||
|
||||
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 */ }");
|
||||
|
Loading…
x
Reference in New Issue
Block a user