summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/Destructuring/array-default-class.js
blob: 5aa9c579b13d55dd41f81b345266625ac8ac3e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var BUGNUMBER = 1322314;
var summary = "Function in computed property in class expression in array destructuring default";

print(BUGNUMBER + ": " + summary);

function* g([
  a = class E {
    [ (function() { return "foo"; })() ]() {
      return 10;
    }
  }
]) {
  yield a;
}

let C = [...g([])][0];
let x = new C();
assertEq(x.foo(), 10);

C = [...g([undefined])][0];
x = new C();
assertEq(x.foo(), 10);

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