Skip to content

Internal error with super method call #1125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ochafik opened this issue Sep 9, 2015 · 6 comments
Closed

Internal error with super method call #1125

ochafik opened this issue Sep 9, 2015 · 6 comments
Assignees

Comments

@ochafik
Copy link

ochafik commented Sep 9, 2015

The following code compiled with --language_in=ECMASCRIPT6_STRICT -O SIMPLE:

class Foo {
  m() {}
}
class Bar extends Foo {
  m() {
    super.m(); // `super['m']()` also crashes
  }
}

Crashes with the following trace:

INTERNAL COMPILER ERROR.
Please report this problem.

Unexpected variable arguments
  Node(NAME arguments): bug_closure.js:5:0
class Bar extends Foo {
  Parent(CALL): bug_closure.js:5:0
class Bar extends Foo {

    at com.google.javascript.jscomp.VarCheck.visit(VarCheck.java:202)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:609)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:603)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:603)
    at com.google.javascript.jscomp.NodeTraversal.traverseBlockScope(NodeTraversal.java:652)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:597)
    at com.google.javascript.jscomp.NodeTraversal.traverseFunction(NodeTraversal.java:643)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:595)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:603)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:603)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:603)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:603)
    at com.google.javascript.jscomp.NodeTraversal.traverseRoots(NodeTraversal.java:314)
    at com.google.javascript.jscomp.VarCheck.process(VarCheck.java:142)
    at com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseOptimizer.java:285)
@concavelenz
Copy link
Contributor

The ES6 to ES6 complication is still experimental, please use --language_out=ECMASCRIPT5_STRICT for the time being.

@MatrixFrog MatrixFrog self-assigned this Sep 9, 2015
@MatrixFrog MatrixFrog added the ES6 label Sep 9, 2015
@ochafik
Copy link
Author

ochafik commented Sep 9, 2015

The ES6 to ES6 compilation is still experimental, please use --language_out=ECMASCRIPT5_STRICT for the time being.

Will do, thanks, but doesn't fix this crash unfortunately.

@MatrixFrog MatrixFrog added the bug label Sep 9, 2015
@MatrixFrog
Copy link
Contributor

I'm actually seeing this for an even simpler case:

class Foo {}
class Bar extends Foo {}

Maybe something to do with one of the recent changes from NodeTraversal.traverse to NodeTraversal.traverseEs6

@MatrixFrog
Copy link
Contributor

git bisect says 3043356 is to blame.

@MatrixFrog
Copy link
Contributor

So it seems to be failing on the synthetic constructor that is inserted by the compiler, which looks like

class Bar extends Foo {
  constructor() {
    Foo.apply(this, arguments);
  }
}

But if you add that constructor explicitly then it doesn't fail. What's strange is, it's crashing in the second checkVars pass (the "sanity check" that happens at the end) not the one that was moved in 3043356.

@ochafik
Copy link
Author

ochafik commented Sep 16, 2015

Yay, thanks guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants