summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/class/geterNoExprClosure.js
blob: e37cb287a96a38bc39f30bf4093bdb1e2ba96075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// getter/setter with expression closure is allowed only in object literal.

assertThrowsInstanceOf(() => eval(`
  class foo {
    constructor() {}

    get a() 1
  }
`), SyntaxError);

assertThrowsInstanceOf(() => eval(`
  class foo {
    constructor() {}

    set a(v) 1
  }
`), SyntaxError);

if (typeof reportCompare === 'function')
    reportCompare(0,0,"OK");