Bug 147150 - [ES6] Class parser does not allow methods named set and get.
Summary: [ES6] Class parser does not allow methods named set and get.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 140491
  Show dependency treegraph
 
Reported: 2015-07-21 08:51 PDT by Oliver Hunt
Modified: 2015-08-05 21:01 PDT (History)
5 users (show)

See Also:


Attachments
Fixes the bug (9.87 KB, patch)
2015-08-05 20:21 PDT, Ryosuke Niwa
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2015-07-21 08:51:08 PDT
class Foo {
    set() {}
};

and

class Bar {
    get() {}
}

should both be valid method names, and yet are being rejected.  The parser needs to check for a ( after the get/set pseudo-keywords rather than assuming it's always a setter or getter.
Comment 1 Ryosuke Niwa 2015-08-05 20:21:12 PDT
Created attachment 258344 [details]
Fixes the bug
Comment 2 Oliver Hunt 2015-08-05 20:41:24 PDT
Comment on attachment 258344 [details]
Fixes the bug

How hard would it be to factor out the property name parsing? Parsepropertyname()->{name, propertytype} 

R+ as is, but if so a follow up to refactor would be nice
Comment 3 Ryosuke Niwa 2015-08-05 20:48:58 PDT
Yup, I'm gonna try that refactoring after fixing the bug 144281.
Comment 4 Ryosuke Niwa 2015-08-05 20:50:02 PDT
(In reply to comment #3)
> Yup, I'm gonna try that refactoring after fixing the bug 144281.

I meant to say the bug 142690.
Comment 5 Ryosuke Niwa 2015-08-05 21:01:12 PDT
Committed r188018: <http://trac.webkit.org/changeset/188018>