google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.4k stars 1.15k forks source link

NullPointerException in calculated default values #3336

Open acceptibru opened 5 years ago

acceptibru commented 5 years ago

Trying to compile following code:

class AnotherClass {
    constructor(id) {
        this.id = id;
    }
    isWhatever() {
        return true;
    }
}
class Bug2 {
    constructor(id) {
        this.id = id;
    }
    async doStuff(doStuff = new AnotherClass(this.id).isWhatever()) {
        console.warn(doStuff);
    }
}
console.warn(new Bug2(1).doStuff());

inside a webpack module with settings java -jar closure-compiler-v20190325.jar --language_in ECMASCRIPT_2017 --language_out ECMASCRIPT5 --compilation_level ADVANCED_OPTIMIZATIONS --jscomp_off=* --js=dist/closure-bug.js --js_output_file=dist/closure-bug.min.js results in error

java.lang.NullPointerException: NAME $jscomp$async$this 109 [length: 4] [source_file: dist/closure-bug.js] at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:895) at com.google.javascript.jscomp.RemoveUnusedCode.getVarForNameNode(RemoveUnusedCode.java:726) at com.google.javascript.jscomp.RemoveUnusedCode.traverseNameNode(RemoveUnusedCode.java:564) at com.google.javascript.jscomp.RemoveUnusedCode.traverseNode(RemoveUnusedCode.java:427) at com.google.javascript.jscomp.RemoveUnusedCode.traverseGetProp(RemoveUnusedCode.java:469) <...>

In case it's important, the code is generated by TypeScript 3.4.3 with settings

{
"compilerOptions": {
   "target": "es2017",
   "module": "es2015"
  }
}

and Webpack 4.30.0 production profile

Full code in attachment. Just the *.js file is enough, .ts is provided merely for information.

There are different attempts, some of them work, some create error.

One case ("SometimesWorks") is particularly weird because it compiles by itself, but creates error if compiled with other working examples. Other working examples compile fine in any combination, and buggy examples create error in any case.

code.zip

acceptibru commented 5 years ago

Here's a link to online example:

https://closure-compiler-debugger.appspot.com/#input0%3D(function%2520(.....%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520Object.defineProperty(exports%252C%2520name%252C%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520enumerable%253A%2520true%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520get%253A%2520getter%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520webpack_require.r%2520%253D%2520function%2520(exports)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520if%2520(typeof%2520Symbol%2520!%253D%253D%2520'undefined'%2520%2526%2526%2520Symbol.toStringTag)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520Object.defineProperty(exports%252C%2520Symbol.toStringTag%252C%2520%257Bvalue%253A%2520'Module'%257D)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520Object.defineProperty(exports%252C%2520'esModule'%252C%2520%257Bvalue%253A%2520true%257D)%253B%250A%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520__webpack_require.t%2520%253D%2520function%2520(value%252C%2520mode)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520if%2520(mode%2520%2526%25201)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520value%2520%253D%2520webpack_require(value)%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520if%2520(mode%2520%2526%25208)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520value%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520if%2520((mode%2520%2526%25204)%2520%2526%2526%2520typeof%2520value%2520%253D%253D%253D%2520'object'%2520%2526%2526%2520value%2520%2526%2526%2520value.esModule)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520value%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520var%2520ns%2520%253D%2520Object.create(null)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520__webpack_require.r(ns)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520Object.defineProperty(ns%252C%2520'default'%252C%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520enumerable%253A%2520true%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520value%253A%2520value%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520if%2520(mode%2520%2526%25202%2520%2526%2526%2520typeof%2520value%2520!%253D%2520'string')%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520for%2520(var%2520key%2520in%2520value)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520webpack_require%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520.d(ns%252C%2520key%252C%2520function%2520(key)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520value%255Bkey%255D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D.bind(null%252C%2520key))%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520return%2520ns%253B%250A%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520webpack_require.n%2520%253D%2520function%2520(module)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520var%2520getter%2520%253D%2520module%2520%2526%2526%2520module.esModule%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%253F%2520function%2520getDefault()%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520module%255B'default'%255D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%253A%2520function%2520getModuleExports()%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520module%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520webpack_require.d(getter%252C%2520'a'%252C%2520getter)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520return%2520getter%253B%250A%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520webpack_require.o%2520%253D%2520function%2520(object%252C%2520property)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520return%2520Object%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520.prototype%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520.hasOwnProperty%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520.call(object%252C%2520property)%250A%2520%2520%2520%2520%257D%253B%250A%2520%2520%2520%2520webpack_require.p%2520%253D%2520%2522%2522%253B%250A%2520%2520%2520%2520return%2520webpack_require(webpack_require.s%2520%253D%25200)%253B%250A%257D)(%255B(function%2520(module%252C%2520webpack_exports%252C%2520webpack_require)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2522use%2520strict%2522%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520webpack_require.r(webpack_exports)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520webpack_require.d(webpack_exports__%252C%2520%2522AnotherClass%2522%252C%2520function%2520()%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520AnotherClass%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520AnotherClass%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520constructor(id)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520this.id%2520%253D%2520id%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520isWhatever()%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520return%2520true%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520Bug1%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520constructor(id)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520this.id%2520%253D%2520id%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520this.doStuff()%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff%2520%253D%2520new%2520AnotherClass(this.id).isWhatever())%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520Bug1(1).id)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520Bug2%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520constructor(id)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520this.id%2520%253D%2520id%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff%2520%253D%2520new%2520AnotherClass(this.id).isWhatever())%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520Bug2(1).doStuff())%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520Bug3%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520constructor(id%252C%2520obj%2520%253D%2520new%2520AnotherClass(id))%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520this.id%2520%253D%2520id%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520this.obj%2520%253D%2520obj%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff%2520%253D%2520this.obj.isWhatever())%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520Bug3(1).doStuff())%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520SometimesWorks%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520constructor(id)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520this.id%2520%253D%2520id%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff%2520%253D%2520new%2520AnotherClass(this.id).isWhatever())%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520SometimesWorks(1).id)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520Works1%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520Works1().doStuff(new%2520AnotherClass(1).isWhatever()))%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520const%2520objw2%2520%253D%2520new%2520AnotherClass(1)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520Works2%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520Works2().doStuff(objw2.isWhatever()))%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520Works3%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520Works3().doStuff())%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520const%2520objw4%2520%253D%2520new%2520AnotherClass(1)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520Works4%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520if%2520(doStuff%2520%253D%253D%253D%2520undefined)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520doStuff%2520%253D%2520objw4.isWhatever()%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520Works4().doStuff())%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520const%2520objw6%2520%253D%2520new%2520AnotherClass(1)%253B%250A%2520%2520%2520%2520%2520%2520%2520%2520class%2520Works6%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520async%2520doStuff(doStuff)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520if%2520(doStuff%2520%253D%253D%253D%2520undefined)%2520%257B%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520doStuff%2520%253D%2520objw6.isWhatever()%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520console.warn(doStuff)%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520%257D%250A%2520%2520%2520%2520%2520%2520%2520%2520console.warn(new%2520Works6().doStuff())%253B%250A%2520%2520%2520%2520%257D)%255D)%253B%26input1%26conformanceConfig%26externs%3Dfunction%2520alert(s)%2520%257B%257D%26refasterjs-template%26ALIAS_ALL_STRINGS%3Dtrue%26AMBIGUATE_PROPERTIES%3Dtrue%26COALESCE_VARIABLE_NAMES%3Dtrue%26COLLAPSE_VARIABLE_DECLARATIONS%3Dtrue%26COLLAPSE_ANONYMOUS_FUNCTIONS%3Dtrue%26COLLAPSE_PROPERTIES%3Dtrue%26COLLAPSE_OBJECT_LITERALS%3Dtrue%26COMPUTE_FUNCTION_SIDE_EFFECTS%3Dtrue%26MARK_NO_SIDE_EFFECT_CALLS%3Dtrue%26CONVERT_TO_DOTTED_PROPERTIES%3Dtrue%26CROSS_CHUNK_CODE_MOTION%3Dtrue%26CROSS_CHUNK_METHOD_MOTION%3Dtrue%26DEAD_ASSIGNMENT_ELIMINATION%3Dtrue%26DEVIRTUALIZE_PROTOTYPE_METHODS%3Dtrue%26DISAMBIGUATE_PROPERTIES%3Dtrue%26EXTRACT_PROTOTYPE_MEMBER_DECLARATIONS%3Dtrue%26FOLD_CONSTANTS%3Dtrue%26INLINE_CONSTANTS%3Dtrue%26INLINE_FUNCTIONS%3Dtrue%26INLINE_PROPERTIES%3Dtrue%26INLINE_VARIABLES%3Dtrue%26LABEL_RENAMING%3Dtrue%26OPTIMIZE_CALLS%3Dtrue%26REMOVE_ABSTRACT_METHODS%3Dtrue%26REMOVE_DEAD_CODE%3Dtrue%26REMOVE_UNUSED_CLASS_PROPERTIES%3Dtrue%26REMOVE_UNUSED_PROTOTYPE_PROPERTIES%3Dtrue%26REMOVE_UNUSED_PROTOTYPE_PROPERTIES_IN_EXTERNS%3Dtrue%26REMOVE_UNUSED_VARIABLES%3Dtrue%26REWRITE_FUNCTION_EXPRESSIONS%3Dtrue%26SMART_NAME_REMOVAL%3Dtrue%26USE_TYPES_FOR_LOCAL_OPTIMIZATION%3Dtrue%26VARIABLE_RENAMING%3Dtrue%26PROPERTY_RENAMING%3Dtrue%26MOVE_FUNCTION_DECLARATIONS%3Dtrue%26SYNTHETIC_BLOCK_MARKER%3Dtrue%26CHROME_PASS%3Dtrue%26PRESERVE_TYPE_ANNOTATIONS%3Dtrue%26PRETTY_PRINT%3Dtrue)

tjgq commented 5 years ago

Simpler repro: https://closure-compiler-debugger.appspot.com/#input0%3Dvar%2520o%2520%253D%2520%257B%257D%253B%250A%250AObject.defineProperty(o%252C%2520Symbol(%2522foo%2522)%252C%2520%257Bvalue%253A%2520%2522bar%2522%257D)%253B%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3Dtrue%26ALIAS_ALL_STRINGS%3Dtrue%26AMBIGUATE_PROPERTIES%3Dtrue%26COALESCE_VARIABLE_NAMES%3Dtrue%26COLLAPSE_VARIABLE_DECLARATIONS%3Dtrue%26COLLAPSE_ANONYMOUS_FUNCTIONS%3Dtrue%26COLLAPSE_PROPERTIES%3Dtrue%26COLLAPSE_OBJECT_LITERALS%3Dtrue%26COMPUTE_FUNCTION_SIDE_EFFECTS%3Dtrue%26MARK_NO_SIDE_EFFECT_CALLS%3Dtrue%26CONVERT_TO_DOTTED_PROPERTIES%3Dtrue%26CROSS_CHUNK_CODE_MOTION%3Dtrue%26CROSS_CHUNK_METHOD_MOTION%3Dtrue%26DEAD_ASSIGNMENT_ELIMINATION%3Dtrue%26DEVIRTUALIZE_PROTOTYPE_METHODS%3Dtrue%26DISAMBIGUATE_PROPERTIES%3Dtrue%26EXTRACT_PROTOTYPE_MEMBER_DECLARATIONS%3Dtrue%26FOLD_CONSTANTS%3Dtrue%26INLINE_CONSTANTS%3Dtrue%26INLINE_FUNCTIONS%3Dtrue%26INLINE_PROPERTIES%3Dtrue%26INLINE_VARIABLES%3Dtrue%26LABEL_RENAMING%3Dtrue%26OPTIMIZE_CALLS%3Dtrue%26REMOVE_ABSTRACT_METHODS%3Dtrue%26REMOVE_DEAD_CODE%3Dtrue%26REMOVE_UNUSED_CLASS_PROPERTIES%3Dtrue%26REMOVE_UNUSED_PROTOTYPE_PROPERTIES%3Dtrue%26REMOVE_UNUSED_PROTOTYPE_PROPERTIES_IN_EXTERNS%3Dtrue%26REMOVE_UNUSED_VARIABLES%3Dtrue%26REWRITE_FUNCTION_EXPRESSIONS%3Dtrue%26SMART_NAME_REMOVAL%3Dtrue%26USE_TYPES_FOR_LOCAL_OPTIMIZATION%3Dtrue%26VARIABLE_RENAMING%3Dtrue%26PROPERTY_RENAMING%3Dtrue%26MOVE_FUNCTION_DECLARATIONS%3Dtrue%26SYNTHETIC_BLOCK_MARKER%3Dtrue%26CHROME_PASS%3Dtrue%26PRESERVE_TYPE_ANNOTATIONS%3Dtrue%26PRETTY_PRINT%3Dtrue

Actually, it looks like this isn't related to symbols at all; the compiler will crash if the second argument to Object.defineProperty is anything other than a string literal:

https://closure-compiler-debugger.appspot.com/#input0%3Dvar%2520o%2520%253D%2520%257B%257D%253B%250A%250Afunction%2520s()%2520%257B%250A%2520%2520return%2520%2522foo%2522%253B%250A%257D%250A%250AObject.defineProperty(o%252C%2520s()%252C%2520%257Bvalue%253A%2520%2522bar%2522%257D)%253B%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3Dtrue%26ALIAS_ALL_STRINGS%3Dtrue%26AMBIGUATE_PROPERTIES%3Dtrue%26COALESCE_VARIABLE_NAMES%3Dtrue%26COLLAPSE_VARIABLE_DECLARATIONS%3Dtrue%26COLLAPSE_ANONYMOUS_FUNCTIONS%3Dtrue%26COLLAPSE_PROPERTIES%3Dtrue%26COLLAPSE_OBJECT_LITERALS%3Dtrue%26COMPUTE_FUNCTION_SIDE_EFFECTS%3Dtrue%26MARK_NO_SIDE_EFFECT_CALLS%3Dtrue%26CONVERT_TO_DOTTED_PROPERTIES%3Dtrue%26CROSS_CHUNK_CODE_MOTION%3Dtrue%26CROSS_CHUNK_METHOD_MOTION%3Dtrue%26DEAD_ASSIGNMENT_ELIMINATION%3Dtrue%26DEVIRTUALIZE_PROTOTYPE_METHODS%3Dtrue%26DISAMBIGUATE_PROPERTIES%3Dtrue%26EXTRACT_PROTOTYPE_MEMBER_DECLARATIONS%3Dtrue%26FOLD_CONSTANTS%3Dtrue%26INLINE_CONSTANTS%3Dtrue%26INLINE_FUNCTIONS%3Dtrue%26INLINE_PROPERTIES%3Dtrue%26INLINE_VARIABLES%3Dtrue%26LABEL_RENAMING%3Dtrue%26OPTIMIZE_CALLS%3Dtrue%26REMOVE_ABSTRACT_METHODS%3Dtrue%26REMOVE_DEAD_CODE%3Dtrue%26REMOVE_UNUSED_CLASS_PROPERTIES%3Dtrue%26REMOVE_UNUSED_PROTOTYPE_PROPERTIES%3Dtrue%26REMOVE_UNUSED_PROTOTYPE_PROPERTIES_IN_EXTERNS%3Dtrue%26REMOVE_UNUSED_VARIABLES%3Dtrue%26REWRITE_FUNCTION_EXPRESSIONS%3Dtrue%26SMART_NAME_REMOVAL%3Dtrue%26USE_TYPES_FOR_LOCAL_OPTIMIZATION%3Dtrue%26VARIABLE_RENAMING%3Dtrue%26PROPERTY_RENAMING%3Dtrue%26MOVE_FUNCTION_DECLARATIONS%3Dtrue%26SYNTHETIC_BLOCK_MARKER%3Dtrue%26CHROME_PASS%3Dtrue%26PRESERVE_TYPE_ANNOTATIONS%3Dtrue%26PRETTY_PRINT%3Dtrue

tjgq commented 5 years ago

Created Google internal issue b/130739118

tjgq commented 5 years ago

Since the crash is in ChromePass, can you try passing --chrome_pass=off as a workaround and let us know if it works?