Bug 247784 - Async arrow function being `undefined`
Summary: Async arrow function being `undefined`
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-11 00:53 PST by Kanguk Lee
Modified: 2022-11-13 19:47 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kanguk Lee 2022-11-11 00:53:30 PST
Hello,

`x` is `undefined` after executing `let x = async x => { for await ( { x } of [ 0 ] ) ; } ; x ( ) ;` in WebKit JSC,
but I think that it is expected to be `async x => ....`:

---
$ jsc
>>> let x = async x => { for await ( { x } of [ 0 ] ) ; } ; x ( ) ;
[object Promise]
>>> x
undefined
>>>
---

while other engines behave like:

---
# V8
V8 version 10.9.0
d8> let x = async x => { for await ( { x } of [ 0 ] ) ; } ; x ( ) ;
[object Promise]
d8> x
async x => { for await ( { x } of [ 0 ] ) ; }
d8>
---


WebKit version: 615.1.10
Comment 1 Yusuke Suzuki 2022-11-13 19:47:16 PST
It is JSC shell's behavior that `let` is scoped to this line.
So, it is not defined as a standard.