Open
Description
In certain cases, unused Object.keys() is not elided.
Consider
Object.keys({
"a": 1,
"b": 2,
});
google-closure-compiler --js a.js -O ADVANCED
outputs [JSC_USELESS_CODE] however
const a = Object.keys({
"a": 1,
"b": 2,
});
google-closure-compiler --js a.js -O ADVANCED
outputs Object.keys({a:1,b:2});
Namely assigning an Object.keys() to an unused variable leads to elimination of the variable but not the method call.
The externs definition seems correct but something else is interfering.
Metadata
Metadata
Assignees
Labels
No labels