OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:compiler/src/compiler.dart' show Compiler; | 7 import 'package:compiler/src/compiler.dart' show Compiler; |
8 import 'package:compiler/src/elements/elements.dart' show Element; | 8 import 'package:compiler/src/elements/elements.dart' show Element; |
9 import 'package:compiler/src/js_backend/backend.dart' as js show JavaScriptBacke
nd; | 9 import 'package:compiler/src/js_backend/backend.dart' as js show JavaScriptBacke
nd; |
10 import 'package:compiler/src/commandline_options.dart' show Flags; | 10 import 'package:compiler/src/commandline_options.dart' show Flags; |
(...skipping 18 matching lines...) Expand all Loading... |
29 expect(result.isSuccess, isTrue); | 29 expect(result.isSuccess, isTrue); |
30 Compiler compiler = result.compiler; | 30 Compiler compiler = result.compiler; |
31 Element element = compiler.mainApp.find(entry); | 31 Element element = compiler.mainApp.find(entry); |
32 js.JavaScriptBackend backend = compiler.backend; | 32 js.JavaScriptBackend backend = compiler.backend; |
33 return backend.getGeneratedCode(element); | 33 return backend.getGeneratedCode(element); |
34 } | 34 } |
35 | 35 |
36 Future check(String code, {String entry: 'main'}) async { | 36 Future check(String code, {String entry: 'main'}) async { |
37 var original = await compile(code, entry: entry, useKernel: false); | 37 var original = await compile(code, entry: entry, useKernel: false); |
38 var kernel = await compile(code, entry: entry, useKernel: true); | 38 var kernel = await compile(code, entry: entry, useKernel: true); |
39 expect(original, kernel); | 39 expect(kernel, original); |
40 } | 40 } |
OLD | NEW |