<?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>271946</bug_id>
          
          <creation_ts>2024-03-30 22:44:00 -0700</creation_ts>
          <short_desc>Inconsistent output of Function.prototype.toString for accessor properties</short_desc>
          <delta_ts>2024-05-15 13:57:36 -0700</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 Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=274224</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>274225</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sosuke Suzuki">sosuke</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ashvayka</cc>
    
    <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2025000</commentid>
    <comment_count>0</comment_count>
    <who name="Sosuke Suzuki">sosuke</who>
    <bug_when>2024-03-30 22:44:00 -0700</bug_when>
    <thetext>Since `RegExp.input` is an accessor property, it is expected that the result of `Function.prototype.toString` would include &quot;get&quot; or &quot;set, but JSC doesn&apos;t do that[1].

```js
const regExpInputGetter = Object.getOwnPropertyDescriptor(RegExp, &quot;input&quot;).get;

print(Function.prototype.toString.call(regExpInputGetter));
// Actual:
// function input() {
//     [native code]
// }
// Expected:
// function get input() {
//     [native code]
// }
```

On the other hand, it returns expected string for  properties like `RegExp.prototype.unicode`:

```js
const regExpPrototypeUnicodeGetter = Object.getOwnPropertyDescriptor(RegExp.prototype, &quot;unicode&quot;).get;

print(Function.prototype.toString.call(regExpPrototypeUnicodeGetter));
// function get unicode() {
//    [native code]
// }
```

[1]: https://tc39.es/ecma262/#sec-function.prototype.tostring</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025007</commentid>
    <comment_count>1</comment_count>
    <who name="Sosuke Suzuki">sosuke</who>
    <bug_when>2024-03-31 00:11:10 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/26660</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025222</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-04-01 14:39:58 -0700</bug_when>
    <thetext>Committed 276904@main (1ff045b365bb): &lt;https://commits.webkit.org/276904@main&gt;

Reviewed commits have been landed. Closing PR #26660 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025223</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-04-01 14:40:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/125739577&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2035609</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2024-05-15 13:11:26 -0700</bug_when>
    <thetext>Reopened Bugzilla.
Breaks https://www.tax.ny.gov/online/., tracking revert in https://bugs.webkit.org/show_bug.cgi?id=274225.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2035611</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2024-05-15 13:19:50 -0700</bug_when>
    <thetext>Instead of re-opening this old bug, let&apos;s track the re-landing of this change (along with https://bugs.webkit.org/show_bug.cgi?id=272082) in https://bugs.webkit.org/show_bug.cgi?id=274224.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2035628</commentid>
    <comment_count>6</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2024-05-15 13:57:36 -0700</bug_when>
    <thetext>Reverted in 278825@main (see https://bugs.webkit.org/show_bug.cgi?id=274225). Please work on the fix for re-landing in https://bugs.webkit.org/show_bug.cgi?id=274224.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>