Summary: | Parameter of async function is undefined if it reassigned later | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | csongor.szilagyi | ||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED CONFIGURATION CHANGED | ||||||
Severity: | Normal | CC: | ahmad.saleem792, bogdanb, karlcow, mark.lam, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Safari 17 | ||||||
Hardware: | Mac (Apple Silicon) | ||||||
OS: | macOS 14 | ||||||
Attachments: |
|
I get the same output in the 3 browsers [Log] 0 (attachment.cgi, line 6) [Log] 1 (attachment.cgi, line 8) [Log] 0 (attachment.cgi, line 11) With Safari Technology Preview 190 19619.1.5.5.2 Firefox Nightly 125.0a1 12524.3.12 Google Chrome Canary 125.0.6371.0 6371.0 I can confirm that it works in Technology Preview 190. Looking forward to be included in the main build too. Thanks! |
Created attachment 470434 [details] A short html snippet to reproduce the issue Consider the following async function: async function test_1(a) { console.log(a) var a = a === 0 ? 1 : 2; console.log(a) } test_1(1); ## Expected output: 1 2 ## Actual output: undefined 2 Additional note: if the parameter is not reassigned in the function, the console.log prints the correct value. Expected output can be tested in Chrome, Firefox, Edge