-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
internal-issue-createdAn internal Google issue has been created to track this GitHub issueAn internal Google issue has been created to track this GitHub issuetriage-doneHas been reviewed by someone on triage rotation.Has been reviewed by someone on triage rotation.
Description
Closure Compiler with advanced optimizations fails to optimize the expression {a:0}.a
to 0
in some cases.
When running:
echo console.log({a:0}.a) | java -jar closure-compiler-v20191027.jar -O ADVANCED
I get console.log({a:0}.a);
but when running:
echo console.log({a:0}.a===0) | java -jar closure-compiler-v20191027.jar -O ADVANCED
I get console.log(!0);
.
It seems that the compiler knows that {a:0}.a
can be reduced to 0
, but doesn't always do it for no apparent reason.
Metadata
Metadata
Assignees
Labels
internal-issue-createdAn internal Google issue has been created to track this GitHub issueAn internal Google issue has been created to track this GitHub issuetriage-doneHas been reviewed by someone on triage rotation.Has been reviewed by someone on triage rotation.