Consider the following JavaScript code example: function foo(x) { console.log(x); var x = 2; console.log(x); } foo(1); async function bar(x) { console.log(x); var x = 2; console.log(x); } bar(1); Running this example in stable Chromium or Firefox versions produces the following expected result: 1 2 1 2 Running this example in Safari produces the following *unexpected* result: 1 2 undefined 2 This issue reproduces in Safari 12.x, 13.x, 14.x on macOS and iOS. This issue reproduces in Safari 14.1.1 on macOS 11.4. Apparently, redeclaring the argument `x` of an async function with `var x` in the function's body causes the initial argument to lose its value and become `undefined`. As shown in the above example, this behavior is specific to async functions and doesn't reproduce in non-async functions. Redeclaring function arguments in this way is a common technique used by code minifiers such as uglify-js, as that sometimes allows reusing shorter variable names.
<rdar://problem/78818618>
*** This bug has been marked as a duplicate of bug 223533 ***