OLD | NEW |
1 Tests for ES6 class syntax expressions | 1 Tests for ES6 class syntax expressions |
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 constructorCallCount is 0 | 6 PASS constructorCallCount is 0 |
7 PASS A.someStaticMethod() is staticMethodValue | 7 PASS A.someStaticMethod() is staticMethodValue |
8 PASS A.someStaticGetter is getterValue | 8 PASS A.someStaticGetter is getterValue |
9 PASS setterValue = undefined; A.someStaticSetter = 123; setterValue is 123 | 9 PASS setterValue = undefined; A.someStaticSetter = 123; setterValue is 123 |
10 PASS (new A).someInstanceMethod() is instanceMethodValue | 10 PASS (new A).someInstanceMethod() is instanceMethodValue |
(...skipping 12 matching lines...) Expand all Loading... |
23 PASS x = class { get constructor() {} } threw exception SyntaxError: Class const
ructor may not be an accessor. | 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. | 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. | 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 | 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. | 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. | 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. | 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. | 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 | 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. | 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 {. | 33 PASS x = class { constructor() {} set foo({x, y}) {} } did not throw exception. |
34 PASS x = class { constructor() {} set foo() {} } threw exception SyntaxError: Se
tter must have exactly one formal parameter.. | 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.. | 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. | 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.. | 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 {. | 38 PASS x = class { constructor() {} get foo({x, y}) {} } threw exception SyntaxErr
or: Getter must not have any formal parameters.. |
39 PASS successfullyParsed is true | 39 PASS successfullyParsed is true |
40 | 40 |
41 TEST COMPLETE | 41 TEST COMPLETE |
OLD | NEW |