Skip to content

Short aliases and classes #4

Description

@sjalexandre

Hi,

First of all, thank you for creating this fork. It's exactly what I've been looking for.

I ran into an issue where the closure compiler throws an error when a short alias is used in an include within a namespaced Class.

For example, the following compiles fine:

include test.Test3 as test3

class Test extends test.Test2
    constructor: ->
        console.log("i am test")

However, if you qualify Test with a package name, it throws an error:

include test.Test3 as test3

class test.Test extends test.Test2
    constructor: ->
        console.log("i am test")

java.lang.RuntimeException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
null
  Node(NAME Arguments): externs.zip//es3.js:30:9
function Arguments() {}
  Parent(FUNCTION Arguments): externs.zip//es3.js:30:0
function Arguments() {}

    at com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.java:740)
    at com.google.javascript.jscomp.Compiler.compile(Compiler.java:652)
    at com.google.javascript.jscomp.Compiler.compile(Compiler.java:608)
    at com.google.javascript.jscomp.AbstractCommandLineRunner.doRun(AbstractCommandLineRunner.java:778)
    at com.google.javascript.jscomp.AbstractCommandLineRunner.run(AbstractCommandLineRunner.java:372)
    at com.google.javascript.jscomp.CommandLineRunner.main(CommandLineRunner.java:993)

Now, if you remove the shortalias, it compiles fine again:

include test.Test3

class test.Test extends test.Test2
    constructor: ->
        console.log("i am test")

Any thoughts as to why this might be happening?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions