OLD | NEW |
(Empty) | |
| 1 Tests for ES6 class syntax declarations |
| 2 |
| 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
| 4 |
| 5 |
| 6 PASS constructorCallCount is 0 |
| 7 PASS A.someStaticMethod() is staticMethodValue |
| 8 PASS A.someStaticGetter is getterValue |
| 9 PASS setterValue = undefined; A.someStaticSetter = 123; setterValue is 123 |
| 10 PASS (new A).someInstanceMethod() is instanceMethodValue |
| 11 PASS constructorCallCount is 1 |
| 12 PASS (new A).someGetter is getterValue |
| 13 PASS constructorCallCount is 2 |
| 14 PASS (new A).someGetter is getterValue |
| 15 PASS setterValue = undefined; (new A).someSetter = 789; setterValue is 789 |
| 16 PASS (new A).__proto__ is A.prototype |
| 17 PASS A.prototype.constructor is A |
| 18 PASS class threw exception SyntaxError: Unexpected end of input. |
| 19 PASS class [ threw exception SyntaxError: Unexpected token [. |
| 20 PASS class { threw exception SyntaxError: Unexpected token {. |
| 21 PASS class X { threw exception SyntaxError: Unexpected end of input. |
| 22 PASS class X { ( } threw exception SyntaxError: Unexpected token (. |
| 23 PASS class X {} did not throw exception. |
| 24 PASS class X { constructor() {} constructor() {} } threw exception SyntaxError:
A class may only have one constructor. |
| 25 PASS class X { get constructor() {} } threw exception SyntaxError: Class constru
ctor may not be an accessor. |
| 26 PASS class X { set constructor() {} } threw exception SyntaxError: Class constru
ctor may not be an accessor. |
| 27 PASS class X { constructor() {} static constructor() { return staticMethodValue;
} } did not throw exception. |
| 28 PASS class X { constructor() {} static constructor() { return staticMethodValue;
} }; X.constructor() is staticMethodValue |
| 29 PASS class X { constructor() {} static prototype() {} } threw exception SyntaxEr
ror: Classes may not have static property named prototype. |
| 30 PASS class X { constructor() {} static get prototype() {} } threw exception Synt
axError: Classes may not have static property named prototype. |
| 31 PASS class X { constructor() {} static set prototype() {} } threw exception Synt
axError: Classes may not have static property named prototype. |
| 32 PASS class X { constructor() {} prototype() { return instanceMethodValue; } } di
d not throw exception. |
| 33 PASS class X { constructor() {} prototype() { return instanceMethodValue; } }; (
new X).prototype() is instanceMethodValue |
| 34 PASS class X { constructor() {} set foo(a) {} } did not throw exception. |
| 35 FAIL class X { constructor() {} set foo({x, y}) {} } should not throw exception.
Threw exception SyntaxError: Unexpected token {. |
| 36 PASS class X { constructor() {} set foo() {} } threw exception SyntaxError: Sett
er must have exactly one formal parameter.. |
| 37 PASS class X { constructor() {} set foo(a, b) {} } threw exception SyntaxError:
Setter must have exactly one formal parameter.. |
| 38 PASS class X { constructor() {} get foo() {} } did not throw exception. |
| 39 PASS class X { constructor() {} get foo(x) {} } threw exception SyntaxError: Get
ter must not have any formal parameters.. |
| 40 PASS class X { constructor() {} get foo({x, y}) {} } threw exception SyntaxError
: Unexpected token {. |
| 41 PASS successfullyParsed is true |
| 42 |
| 43 TEST COMPLETE |
OLD | NEW |