http://trac.webkit.org/browser/trunk/LayoutTests/js/script-tests/class-syntax-super.js#L44 shouldNotThrow('x = class extends Base { constructor() { super(); } method() { return new super } }'); This is invalid. `new super` is not allowed.
*** Bug 144281 has been marked as a duplicate of this bug. ***
Created attachment 252291 [details] Fixes the bug
Comment on attachment 252291 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=252291&action=review r=me > Source/JavaScriptCore/ChangeLog:3 > + ES6 classe: new super is not allowed Typo: "classe" => "classes" > Source/JavaScriptCore/parser/Parser.cpp:2527 > + semanticFailIfTrue(baseIsSuper && newCount, "Cannot new super"); I think there is room for improvement with this error message. The statement "Cannot new super" feels incomplete. Maybe "Cannot use new with super"? "Cannot call super as a constructor"?
Comment on attachment 252291 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=252291&action=review >> Source/JavaScriptCore/parser/Parser.cpp:2527 >> + semanticFailIfTrue(baseIsSuper && newCount, "Cannot new super"); > > I think there is room for improvement with this error message. The statement "Cannot new super" feels incomplete. Maybe "Cannot use new with super"? "Cannot call super as a constructor"? Let's go with "Cannot use new with super".
Committed r183757: <http://trac.webkit.org/changeset/183757>
Thanks for the review, Joe!