class A { } class B extends A { constructor() { super(); console.log('hi'); super(); } } should fail immediately after 'hi' since "this" is already created. Specifically, step 10 in SuperCall: http://www.ecma-international.org/ecma-262/6.0/#sec-super-keyword-runtime-semantics-evaluation 10. Return thisER.BindThisValue(result). should throw a ReferenceError because of step 3: http://www.ecma-international.org/ecma-262/6.0/#sec-bindthisvalue 3. If envRec.[[thisBindingStatus]] is "initialized", throw a ReferenceError exception.
We have very close issue to this https://bugs.webkit.org/show_bug.cgi?id=151113 that rely on discussion https://esdiscuss.org/topic/duplicate-super-call-behaviour test example: class Foo { constructor() { console.log("foo"); } } class Bar extends Foo { constructor() { super(); console.log("bar"); super(); } } new Bar; If we will strictly follow specs we will have: foo bar foo ReferenceError: This can not be initialized twice.
Does your patch for the bug 151113 also fix this bug? Or do we still need to keep this bug around?
(In reply to comment #2) > Does your patch for the bug 151113 also fix this bug? Or do we still need > to keep this bug around? Yes, I think it is the same issue, so path for 151113 fix this issue.
Let's dupe this bug in that case. *** This bug has been marked as a duplicate of bug 151113 ***