Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

finally + super don't play nice #528

Closed
sigmundch opened this issue Apr 26, 2016 · 4 comments
Closed

finally + super don't play nice #528

sigmundch opened this issue Apr 26, 2016 · 4 comments

Comments

@sigmundch
Copy link
Contributor

sigmundch commented Apr 26, 2016

This is possibly more of an ES6 bug than a DDC bug, but you can probably triage this more accurately,.

I'm seeing issues when making a super method call within a finally block. For example:

class A {
   foo() => print('a');
}

class B {
  foo() => print('b');

  bar() {
    try { ... }
    finally { super.foo(); }
  }
}

The generated code contains finally { super.foo() }, which produces a runtime syntax error saying super keyword unexpected here.

@sigmundch
Copy link
Contributor Author

It's easy to work around though (just pull the super call into a helper method)

@vsmenon
Copy link
Contributor

vsmenon commented Apr 26, 2016

This is related to #499 (though more surprising here). The fix is probably same - the compiler can create a helper method.

@jmesserly
Copy link
Contributor

yup. @sigmundch did you hit this in real code that will block folks? If so please mark P1. thanks :)

@sigmundch
Copy link
Contributor Author

it was in a testing library that was easy to fix locally. In fact, the code was temporary to begin with and a change just landed that got rid of the code that was causing this altogether, so no blocker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants