summaryrefslogtreecommitdiff
path: root/test/built-ins/Function/prototype/toString/setter-object.js
blob: 0e207d25c790b6586e8575bd0344b90556009a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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 (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 */ }");