Properly translate for-in and await for-in without a declaration keyword.

If a for-in loop variable is declared with a type and without a keyword,
e.g., 'var', then we did not translate it correctly.
2 files changed
tree: 2f272e47669d8ee82f100ba9b1619e7feb70463c
  1. bin/
  2. lib/
  3. runtime/
  4. test/
  5. .gitignore
  6. AUTHORS
  7. LICENSE
  8. pubspec.yaml
  9. README.md
README.md

async-await transformer

A prototype (and in progress) implementation of async/await in Dart, via CPS translation.

This transformer is useful for trying async/await with dart2js. The Dart VM natively supports async and await. If you are writing Dart code that runs only in the VM, you do not need this transformer.

How to use

Add this to your pubspec.yaml file:

dependencies:
  async_await:
    git: https://github.com/dart-lang/async_await.git
transformers:
- async_await

Import dart:async in your Dart file:

import 'dart:async';

What works

  • async
  • await
  • await for

What doesn't yet work

See also the open issues.

  • Stack traces are not according to the spec