summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/class/superCallBadDynamicSuperClass.js
blob: f5b3ac3c0caf766c23988752c9c9da30d8dae574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
class base { constructor() { } }

class inst extends base { constructor() { super(); } }
Object.setPrototypeOf(inst, Math.sin);
assertThrowsInstanceOf(() => new inst(), TypeError);

class defaultInst extends base { }
Object.setPrototypeOf(inst, Math.sin);
assertThrowsInstanceOf(() => new inst(), TypeError);

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