<?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>247437</bug_id>
          
          <creation_ts>2022-11-03 09:18:58 -0700</creation_ts>
          <short_desc>`toString` of a generator function is wrong</short_desc>
          <delta_ts>2023-09-27 13:19:03 -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>DUPLICATE</resolution>
          <dup_id>190501</dup_id>
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kanguk Lee">p51lee</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>1910076</commentid>
    <comment_count>0</comment_count>
    <who name="Kanguk Lee">p51lee</who>
    <bug_when>2022-11-03 09:18:58 -0700</bug_when>
    <thetext>// input.js
print (
    String(function * () {})
);
__________________________

Hello,

The space between `function` and `*` should be retained in the result of toString of the generator function, but JSC removes all the space between them.

Running the input.js with JSC prints:

---
$ jsc input.js
function* () {}
---

while other engines behave like:

---
# V8 (used console.log)
$ node input.js
function * () {}

# GraalJS
$ js input.js
function * () {}
---


WebKit version: 615.1.10</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910930</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-07 16:31:59 -0800</bug_when>
    <thetext>&lt;rdar://problem/102065151&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911598</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2022-11-10 10:50:23 -0800</bug_when>
    <thetext>*** Bug 247438 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911599</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2022-11-10 10:50:34 -0800</bug_when>
    <thetext>This is Function#toString thing feature, which is not implemented.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1980608</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Shvayka">ashvayka</who>
    <bug_when>2023-09-27 13:19:03 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 190501 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>