OLD | NEW |
1 Tests for ES6 class syntax "extends" | 1 Tests for ES6 class syntax "extends" |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 PASS (new Base) instanceof Base is true | 6 PASS (new Base) instanceof Base is true |
7 PASS Object.getPrototypeOf(new Base) is Base.prototype | 7 PASS Object.getPrototypeOf(new Base) is Base.prototype |
8 PASS (new Derived) instanceof Derived is true | 8 PASS (new Derived) instanceof Derived is true |
9 PASS Object.getPrototypeOf(new Derived) is Derived.prototype | 9 PASS Object.getPrototypeOf(new Derived) is Derived.prototype |
10 PASS Object.getPrototypeOf(Derived.prototype) is Base.prototype | 10 PASS Object.getPrototypeOf(Derived.prototype) is Base.prototype |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 PASS x = 1; namespace = {}; namespace.A = class { constructor() { } }; try { nam
espace.B = class extends (x++, namespace.A) { constructor() { } } } catch (e) {
} x is 2 | 53 PASS x = 1; namespace = {}; namespace.A = class { constructor() { } }; try { nam
espace.B = class extends (x++, namespace.A) { constructor() { } } } catch (e) {
} x is 2 |
54 PASS x = 1; namespace = {}; namespace.A = class { constructor() { } }; try { nam
espace.B = class extends (namespace.A, x++) { constructor() { } } } catch (e) {
} x is 2 | 54 PASS x = 1; namespace = {}; namespace.A = class { constructor() { } }; try { nam
espace.B = class extends (namespace.A, x++) { constructor() { } } } catch (e) {
} x is 2 |
55 PASS Object.getPrototypeOf((class { constructor () { } }).prototype) is Object.p
rototype | 55 PASS Object.getPrototypeOf((class { constructor () { } }).prototype) is Object.p
rototype |
56 PASS Object.getPrototypeOf((class extends null { constructor () { super(); } }).
prototype) is null | 56 PASS Object.getPrototypeOf((class extends null { constructor () { super(); } }).
prototype) is null |
57 PASS new (class extends undefined { constructor () { this } }) threw exception T
ypeError: Class extends value undefined is not a function or null. | 57 PASS new (class extends undefined { constructor () { this } }) threw exception T
ypeError: Class extends value undefined is not a function or null. |
58 PASS new (class extends undefined { constructor () { super(); } }) threw excepti
on TypeError: Class extends value undefined is not a function or null. | 58 PASS new (class extends undefined { constructor () { super(); } }) threw excepti
on TypeError: Class extends value undefined is not a function or null. |
59 PASS x = {}; new (class extends undefined { constructor () { return x; } }) thre
w exception TypeError: Class extends value undefined is not a function or null. | 59 PASS x = {}; new (class extends undefined { constructor () { return x; } }) thre
w exception TypeError: Class extends value undefined is not a function or null. |
60 PASS y = 12; new (class extends undefined { constructor () { return y; } }) thre
w exception TypeError: Class extends value undefined is not a function or null. | 60 PASS y = 12; new (class extends undefined { constructor () { return y; } }) thre
w exception TypeError: Class extends value undefined is not a function or null. |
61 PASS class x {}; new (class extends null { constructor () { return new x; } }) i
nstanceof x is true | 61 PASS class x {}; new (class extends null { constructor () { return new x; } }) i
nstanceof x is true |
62 PASS new (class extends null { constructor () { this; } }) threw exception Refer
enceError: this is not defined. | 62 PASS new (class extends null { constructor () { this; } }) threw exception Refer
enceError: this is not defined. |
63 PASS new (class extends null { constructor () { super(); } }) threw exception Ty
peError: function () {} is not a constructor. | 63 PASS new (class extends null { constructor () { super(); } }) threw exception Ty
peError: super is not a constructor. |
64 PASS x = {}; new (class extends null { constructor () { return x } }) is x | 64 PASS x = {}; new (class extends null { constructor () { return x } }) is x |
65 PASS y = 12; new (class extends null { constructor () { return y; } }) threw exc
eption TypeError: Derived constructors may only return object or undefined. | 65 PASS y = 12; new (class extends null { constructor () { return y; } }) threw exc
eption TypeError: Derived constructors may only return object or undefined. |
66 PASS class x {}; new (class extends null { constructor () { return new x; } }) i
nstanceof x is true | 66 PASS class x {}; new (class extends null { constructor () { return new x; } }) i
nstanceof x is true |
67 PASS x = null; Object.getPrototypeOf((class extends x { }).prototype) is null | 67 PASS x = null; Object.getPrototypeOf((class extends x { }).prototype) is null |
68 PASS Object.prototype.isPrototypeOf(class { }) is true | 68 PASS Object.prototype.isPrototypeOf(class { }) is true |
69 PASS Function.prototype.isPrototypeOf(class { }) is true | 69 PASS Function.prototype.isPrototypeOf(class { }) is true |
70 PASS successfullyParsed is true | 70 PASS successfullyParsed is true |
71 | 71 |
72 TEST COMPLETE | 72 TEST COMPLETE |
OLD | NEW |