OLD | NEW |
(Empty) | |
| 1 Tests for ES6 class syntax expressions |
| 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 x = class threw exception SyntaxError: Unexpected end of input. |
| 19 PASS x = class { threw exception SyntaxError: Unexpected end of input. |
| 20 PASS x = class { ( } threw exception SyntaxError: Unexpected token (. |
| 21 PASS x = class {} did not throw exception. |
| 22 PASS x = class { constructor() {} constructor() {} } threw exception SyntaxError
: A class may only have one constructor. |
| 23 PASS x = class { get constructor() {} } threw exception SyntaxError: Class const
ructor may not be an accessor. |
| 24 PASS x = class { set constructor() {} } threw exception SyntaxError: Class const
ructor may not be an accessor. |
| 25 PASS x = class { constructor() {} static constructor() { return staticMethodValu
e; } } did not throw exception. |
| 26 PASS x = class { constructor() {} static constructor() { return staticMethodValu
e; } }; x.constructor() is staticMethodValue |
| 27 PASS x = class { constructor() {} static prototype() {} } threw exception Syntax
Error: Classes may not have static property named prototype. |
| 28 PASS x = class { constructor() {} static get prototype() {} } threw exception Sy
ntaxError: Classes may not have static property named prototype. |
| 29 PASS x = class { constructor() {} static set prototype() {} } threw exception Sy
ntaxError: Classes may not have static property named prototype. |
| 30 PASS x = class { constructor() {} prototype() { return instanceMethodValue; } }
did not throw exception. |
| 31 PASS x = class { constructor() {} prototype() { return instanceMethodValue; } };
(new x).prototype() is instanceMethodValue |
| 32 PASS x = class { constructor() {} set foo(a) {} } did not throw exception. |
| 33 FAIL x = class { constructor() {} set foo({x, y}) {} } should not throw exceptio
n. Threw exception SyntaxError: Unexpected token {. |
| 34 PASS x = class { constructor() {} set foo() {} } threw exception SyntaxError: Se
tter must have exactly one formal parameter.. |
| 35 PASS x = class { constructor() {} set foo(a, b) {} } threw exception SyntaxError
: Setter must have exactly one formal parameter.. |
| 36 PASS x = class { constructor() {} get foo() {} } did not throw exception. |
| 37 PASS x = class { constructor() {} get foo(x) {} } threw exception SyntaxError: G
etter must not have any formal parameters.. |
| 38 PASS x = class { constructor() {} get foo({x, y}) {} } threw exception SyntaxErr
or: Unexpected token {. |
| 39 PASS successfullyParsed is true |
| 40 |
| 41 TEST COMPLETE |
OLD | NEW |