Bug 247784
| Summary: | Async arrow function being `undefined` | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kanguk Lee <p51lee> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | mark.lam, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Kanguk Lee
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
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Yusuke Suzuki
It is JSC shell's behavior that `let` is scoped to this line.
So, it is not defined as a standard.