Summary: | super should be available in object literals | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Geoffrey Garen <ggaren> | ||||
Component: | New Bugs | Assignee: | Geoffrey Garen <ggaren> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, keith_miller, mark.lam, msaboff, rniwa, saam | ||||
Priority: | P2 | ||||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Geoffrey Garen
2016-04-22 15:24:42 PDT
Created attachment 277107 [details]
Patch
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? Committed r199927: <http://trac.webkit.org/changeset/199927> |