google / google/closure-compiler
Source Map Generation corrupts property access with setUseOriginalNamesInOutput(true)
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
If you specify any sourceMapOutputPath together with `options.setUseOriginalNamesInOutput(true)`, then any property looses its object:
```javascript
String code = "console.log(document.readyState)";
final Compiler compiler = new Compiler();
final CompilerOptions options = new CompilerOptions();
options.setUseOriginalNamesInOutput(true);
// This option breaks the code:
options.setSourceMapOutputPath("/dev/null"); // any path
final SourceFile input = SourceFile.fromCode("js-input.js", code);
compiler.compile(Arrays.asList(), Arrays.asList(input), options);
final String compiled = compiler.toSource();
System.out.println(compiled); // should be "console.log(x.u);", but is "log(u);"
```
Contributor guide
Assessment
This issue has not been assessed yet.