| Index: tests/compiler/dart2js/codegen_helper.dart
|
| diff --git a/tests/compiler/dart2js/codegen_helper.dart b/tests/compiler/dart2js/codegen_helper.dart
|
| index 23884da29bb2d878ef09eee485e3136dfa17c5ae..f0e1966558def8a89f1968e6c12b885c22a1992e 100644
|
| --- a/tests/compiler/dart2js/codegen_helper.dart
|
| +++ b/tests/compiler/dart2js/codegen_helper.dart
|
| @@ -2,13 +2,15 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| +import 'dart:async';
|
| import 'package:expect/expect.dart';
|
|
|
| import 'memory_source_file_helper.dart';
|
| import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"
|
| show SourceString;
|
|
|
| -Map<String, String> generate(String code, [List<String> options = const []]) {
|
| +Future<Map<String, String>> generate(String code,
|
| + [List<String> options = const []]) {
|
| Uri script = currentDirectory.resolve(nativeToUriPath(new Options().script));
|
| Uri libraryRoot = script.resolve('../../../sdk/');
|
| Uri packageRoot = script.resolve('./packages/');
|
| @@ -24,13 +26,15 @@ Map<String, String> generate(String code, [List<String> options = const []]) {
|
| packageRoot,
|
| options);
|
| Uri uri = Uri.parse('memory:main.dart');
|
| - Expect.isTrue(compiler.run(uri));
|
| - Map<String, String> result = new Map<String, String>();
|
| - for (var element in compiler.backend.generatedCode.keys) {
|
| - if (element.getCompilationUnit().script.uri != uri) continue;
|
| - var name = element.name.slowToString();
|
| - var code = compiler.backend.assembleCode(element);
|
| - result[name] = code;
|
| - }
|
| - return result;
|
| + return compiler.run(uri).then((success) {
|
| + Expect.isTrue(success);
|
| + Map<String, String> result = new Map<String, String>();
|
| + for (var element in compiler.backend.generatedCode.keys) {
|
| + if (element.getCompilationUnit().script.uri != uri) continue;
|
| + var name = element.name.slowToString();
|
| + var code = compiler.backend.assembleCode(element);
|
| + result[name] = code;
|
| + }
|
| + return result;
|
| + });
|
| }
|
|
|