<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>209675</bug_id>
          
          <creation_ts>2020-03-27 12:16:31 -0700</creation_ts>
          <short_desc>[JSC] public-class-field should accept &quot;get&quot; / &quot;set&quot; fields</short_desc>
          <delta_ts>2021-02-01 02:41:13 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=209703</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yusuke Suzuki">ysuzuki</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>caitp</cc>
    
    <cc>mark.lam</cc>
    
    <cc>ross.kirsling</cc>
    
    <cc>ticaiolima</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1634946</commentid>
    <comment_count>0</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-03-27 12:16:31 -0700</bug_when>
    <thetext>Example code.

class A {
static
async
get
test() { }
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1634948</commentid>
    <comment_count>1</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2020-03-27 12:17:41 -0700</bug_when>
    <thetext>Exception: SyntaxError: Unexpected identifier &apos;get&apos;. Expected an opening &apos;(&apos; before a method&apos;s parameter list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1635181</commentid>
    <comment_count>2</comment_count>
    <who name="Caio Lima">ticaiolima</who>
    <bug_when>2020-03-28 08:25:22 -0700</bug_when>
    <thetext>(In reply to Yusuke Suzuki from comment #1)
&gt; Exception: SyntaxError: Unexpected identifier &apos;get&apos;. Expected an opening &apos;(&apos;
&gt; before a method&apos;s parameter list.

This is a tricky one, but I&apos;m not sure if this is a legit bug. The message may sound  confusing, but we could see this as the following program when we apply automatic semicolon insertion (ASI):

```
class A {
static
async;
get
test() { }
}
```

Since we don&apos;t support static class fields yet, the syntax error seems correct, given it is expected `function` or `PropertyName` after `async`(https://tc39.es/ecma262/#prod-AsyncFunctionDeclaration). A case that we could derivate from given example that parses correctly is:

```
class A {
async
get
test() { }
}
```

This should result in an object with field `async` and `get test`. We can define `get`
and `set` as field, but a `FieldDefinition` requires a semicolon (https://tc39.es/proposal-class-fields/#prod-ClassElement). Since `get` or `set` aren&apos;t restricted tokens, there is no ASI there and they are parsed as a setter/getter definition. I remember adding some tests for cases of `get`, `set`, `async` and `static` as field names, but I need to double check if it was here or in Test262. Anyway, increasing test coverage is almost never a bad idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1724167</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2021-02-01 02:41:13 -0800</bug_when>
    <thetext>It is fixed at some point.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>