Closed
Description
Code sample:
function installBaa({ obj }) {
obj.baa = 'foo';
}
const obj = {};
installBaa({ obj });
console.log(obj.baa);
Command:
java -jar compiler.jar --js test.js -O ADVANCED --language_out ECMASCRIPT_2015
Version: v20191027
Expected output: (as output by --language_out ECMASCRIPT5
)
console.log({a:"foo"}.a);
Actual output:
'use strict';console.log({}.a);
It looks like CC is losing the assignment when the target language is ECMASCRIPT_2015
or higher.
The following non-destructered parameter works as expected:
function installRoutes(x) {
x.obj.baa = 'foo';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
An internal Google issue has been created to track this GitHub issueAn internal Google issue has been created to track this GitHub issueHas been reviewed by someone on triage rotation.Has been reviewed by someone on triage rotation.