Home | History | Annotate | Download | only in webkit

Lines Matching refs:new

42 shouldBeTrue('(new Base) instanceof Base');
43 shouldBe('Object.getPrototypeOf(new Base)', 'Base.prototype');
44 shouldBeTrue('(new Derived) instanceof Derived');
45 shouldBe('Object.getPrototypeOf(new Derived)', 'Derived.prototype');
47 shouldBe('(new Derived).baseMethod()', '"base"');
48 shouldBe('(new Derived).overridenMethod()', '"derived"');
65 shouldNotThrow('baseWithBadPrototype = function () {}; baseWithBadPrototype.prototype = 3; new baseWithBadPrototype');
90 shouldThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends new namespace.A { constructor() { } }');
91 shouldThrow('namespace = {}; namespace.A = class { constructor() { } }; namespace.B = class extends new namespace.A() { constructor() { } }');
97 shouldThrow('new (class extends undefined { constructor () { this } })', '"TypeError: Class extends value undefined is not a function or null"');
98 shouldThrow('new (class extends undefined { constructor () { super(); } })', '"TypeError: Class extends value undefined is not a function or null"');
99 shouldThrow('x = {}; new (class extends undefined { constructor () { return x; } })', '"TypeError: Class extends value undefined is not a function or null"');
100 shouldThrow('y = 12; new (class extends undefined { constructor () { return y; } })', '"TypeError: Class extends value undefined is not a function or null"');
101 shouldBeTrue ('class x {}; new (class extends null { constructor () { return new x; } }) instanceof x');
102 shouldThrow('new (class extends null { constructor () { this; } })', '"ReferenceError: this is not defined"');
103 shouldThrow('new (class extends null { constructor () { super(); } })', '"TypeError: super is not a constructor"');
104 shouldBe('x = {}; new (class extends null { constructor () { return x } })', 'x');
105 shouldThrow('y = 12; new (class extends null { constructor () { return y; } })', '"TypeError: Derived constructors may only return object or undefined"');
106 shouldBeTrue ('class x {}; new (class extends null { constructor () { return new x; } }) instanceof x');