proposal-logical-assignment
should not assign anonymous function name
#11362
Labels
claimed
i: bug
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
Spec: Logical Assignment
Bug Report
Current Behavior
The following snippet, after transform will print string
"f"
to the consoleInput Code
Expected behavior/code
According to https://tc39.es/proposal-logical-assignment/#sec-assignment-operators-runtime-semantics-evaluation, the anonymous function is not applied with NamedEvaluation, so it should print an empty string to the console.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
babel.config.js
Environment
REPL.
Solution
Transform
f ??= function() {}
tof = f ?? function() {}
may fix this issue. Or we leave a caveat note that we are not supporting function name in this plugin.The text was updated successfully, but these errors were encountered: