Skip to content

Super calls on computed properties crash the compiler #1184

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 Oct 5, 2015 · 0 comments
Closed

Super calls on computed properties crash the compiler #1184

ochafik opened this issue Oct 5, 2015 · 0 comments
Assignees
Labels

Comments

@ochafik
Copy link

ochafik commented Oct 5, 2015

Offending code:

class Foo {
  ['m']() { return 1; }
}
class Bar extends Foo {
  ['m']() {
    return super['m']() + 1;
  }
}
console.log(new Bar()['m']());

Produces the following error with --language_in=ES6 --language_out=ES5 -O SIMPLE:

java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.

null
  Node(SUPER): /usr/local/google/home/ochafik/super.js:19:11
    return super['M']() + 1;
  Parent(GETELEM): /usr/local/google/home/ochafik/super.js:19:11
    return super['M']() + 1;

    at com.google.javascript.jscomp.Es6ConvertSuper.visitSuper(Es6ConvertSuper.java:135)
    at com.google.javascript.jscomp.Es6ConvertSuper.visit(Es6ConvertSuper.java:70)
    at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:609)

Note that the following compiles fine since #1125:

class Foo {
  m() { return 1; }
}
class Bar extends Foo {
  m() {
    return super.m() + 1;
  }
}
console.log(new Bar().m());

(happens with output from DDC, where we sometimes use Symbols in conjunction with computed props).

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

No branches or pull requests

2 participants