Description
The compilation of a file, which contains only one line:
document.querySelector(".test").some_prop = true;
leads to an empty output when using the compiler with these flags:
java -jar compiler.jar --compilation_level=ADVANCED_OPTIMIZATIONS --jscomp_off=checkTypes --js=in.js --js_output_file=out.js
However, enabling the checkTypes warnings (--jscomp_warning=checkTypes
) fixes it and the output is ok: document.querySelector(".test").a=!0;
It doesn't matter if the altered property is a custom "some_prop" or a built-in one like the "className" or "id". Also, the querySelectorAll method doesn't have such an issue and the following code is compiled without problems:
document.querySelectorAll(".test")[0].some_prop = true;
It's reproduced in GCC v20161201.