blob: b085ce7bee5e289c369cdf6f2ecd823d1fca189d [file] [log] [blame]
Tests for ES6 arrow function, access to the super property in arrow function
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS (new B()).getValueParentFunction() is expectedValue
PASS (new C(false)).value is expectedValue
PASS (new C(true)) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS E.getParentStaticValue() is expectedValue
PASS f.prop is expectedValue + "-" + expectedValue
PASS f.prop is expectedValue + "-" + "new-value"
PASS (new F()).getParentValue() is expectedValue
PASS (new F()).genGetParentValue().next().value is expectedValue
PASS (new F()).genGetParentValueDeepArrow().next().value is expectedValue
PASS (new class extends A { constructor() { ((a = super(), b = super.getValue())=>{ this.id = b; })() } }).id is expectedValue
PASS (new class extends A { constructor() { ((a = super(), b = new.target)=>{ this.newTarget = b; })(); expectedNewTarget = new.target;} }).newTarget is expectedNewTarget
PASS (new class extends A { constructor() { ((a = super.getValue())=>{ this.id = a; })() } }) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS (new class extends A { constructor() { ((a = super.getValue(), b=super())=>{ this.id = a; })() } }) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS (new class extends F { constructor() { ((a = super.prop)=>{ return a; })() } }) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS (new class extends F { constructor() { ((a = super.prop, b=super())=>{ return a; })() } }) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS (new class extends F { constructor() { ((a = (super.prop = "value"))=>{ this.id = a; })() } }) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS (new class extends F { constructor() { ((a = (super.prop = "value"), b=super())=>{ this.id = a; })() } }) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS (new class extends F { constructor() { ((a = super.genGetParentValue().next().value)=>{ this.id = a; })() } }) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS (new class extends F { constructor() { ((a = super.genGetParentValue().next().value, b=super())=>{ this.id = a; })() } }) threw exception ReferenceError: 'super()' must be called in derived constructor before accessing |this| or returning non-object..
PASS successfullyParsed is true
TEST COMPLETE