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