Bug 147150

Summary: [ES6] Class parser does not allow methods named set and get.
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: JavaScriptCoreAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, fpizlo, ggaren, rniwa, saam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 140491    
Attachments:
Description Flags
Fixes the bug oliver: review+

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>