Skip to content

inconsistent syntax error involving "=>" and "throw", vm versus dart2js #8261

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
DartBot opened this issue Feb 1, 2013 · 1 comment
Closed
Labels
closed-duplicate Closed in favor of an existing report

Comments

@DartBot
Copy link

DartBot commented Feb 1, 2013

This issue was originally filed by @jptrainor


What steps will reproduce the problem?

  1. Call the then() method on a future. Supply an onError method as follows:
     
       aFuture.then(
         () { doSomething },
         onError: (AsyncError error) => throw new Exception());
  2. Run this in the dart VM. It won't complain about the syntax error.
  3. Run this through dart2js. It will complain "expected an expression, but got 'throw'"

What is the expected output? What do you see instead?

I expect both the VM and dart2j to either accept it or reject it. I haven't studied what the language spec says about this case. If that syntax is correct then it is a dart2js bug. If not then vice versa.

Note that the Dart Editor doesn't flag the "throw" as an error.

What version of the product are you using? On what operating system?

Dart Editor version 0.3.2_r17657
Dart SDK version 0.3.2.0_r17657
OSX 10.8.2

@kasperl
Copy link

kasperl commented Feb 4, 2013

This is a bug in dart2js so marking this as a duplicate of issue #4874.


Added Duplicate label.
Marked as being merged into #4874.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

2 participants