RESOLVED FIXED 152108
ES6 Class syntax. Invoking method of parent class in constructor before super() lead to crash
https://bugs.webkit.org/show_bug.cgi?id=152108
Summary ES6 Class syntax. Invoking method of parent class in constructor before super...
GSkachkov
Reported 2015-12-09 23:37:19 PST
Invoking method of parent class in constructor before super() lead to crash. See example: <script> class A { getValue() { return 'test-value'; } } class B extends A { constructor () { let _value = super.getValue(); super(); this.value = _value; } } let b = new B(); console.log(b.value); </script>
Attachments
dump_error (75.06 KB, application/octet-stream)
2015-12-09 23:42 PST, GSkachkov
no flags
[PATCH] Proposed Fix (4.57 KB, patch)
2016-03-25 22:58 PDT, Joseph Pecoraro
no flags
GSkachkov
Comment 1 2015-12-09 23:42:13 PST
Created attachment 267075 [details] dump_error Error dump, that I received on r193804
Joseph Pecoraro
Comment 2 2016-03-25 22:58:41 PDT
(In reply to comment #0) > Invoking method of parent class in constructor before super() lead to crash. > > class B extends A { > constructor () { > let _value = super.getValue(); > super(); > this.value = _value; > } > } I think this was supposed to be an arrow function: let _value = () => { super.getValue() }; _value(); super(); At least Based on the FIXME in the LayoutTests/js test. However, it looks like this has been fixed! Lets enable the test to ensure we get a bit extra coverage and remove the FIXMEs in LayoutTests.
Joseph Pecoraro
Comment 3 2016-03-25 22:58:56 PDT
Created attachment 274980 [details] [PATCH] Proposed Fix
WebKit Commit Bot
Comment 4 2016-03-26 00:08:22 PDT
Comment on attachment 274980 [details] [PATCH] Proposed Fix Clearing flags on attachment: 274980 Committed r198714: <http://trac.webkit.org/changeset/198714>
WebKit Commit Bot
Comment 5 2016-03-26 00:08:25 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.