WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
156933
super should be available in object literals
https://bugs.webkit.org/show_bug.cgi?id=156933
Summary
super should be available in object literals
Geoffrey Garen
Reported
2016-04-22 15:24:42 PDT
super should be available in object literals
Attachments
Patch
(61.72 KB, patch)
2016-04-22 15:33 PDT
,
Geoffrey Garen
saam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Geoffrey Garen
Comment 1
2016-04-22 15:33:17 PDT
Created
attachment 277107
[details]
Patch
Saam Barati
Comment 2
2016-04-22 15:46:18 PDT
Comment on
attachment 277107
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=277107&action=review
r=me with comments.
> Source/JavaScriptCore/ChangeLog:48 > + about the list of places you can use super.
I agree. I wish our parser added the line/column to the "super not allowed in this context" error message.
> LayoutTests/js/script-tests/object-literal-methods.js:91 > +shouldThrow("{ f() { return super.f(); } }.f()"); > +shouldThrow("new ({ f() { return super(); }.f)"); > +shouldThrow("o = { f() { } }; new ({ __proto__: o, f() { return super(); } }).f"); > +shouldBeTrue("o = { f() { return true; } }; ({ __proto__: o, f() { return super.f(); } }).f()"); > +shouldBeTrue("o = { get p() { return true; } }; ({ __proto__: o, get p() { return super.p; } }).p"); > +shouldBeTrue("o = { set p(p2) { } }; ({ __proto__: o, set p(p2) { super.p = p2; } }).p = true");
Can you also add some tests for arrow functions to make sure they close over 'super' properly in object literal method syntax?
Geoffrey Garen
Comment 3
2016-04-22 16:04:31 PDT
Committed
r199927
: <
http://trac.webkit.org/changeset/199927
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug