OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
7 import "package:async_helper/async_helper.dart"; | 7 import "package:async_helper/async_helper.dart"; |
8 import "package:compiler/implementation/dart2jslib.dart"; | 8 import "package:compiler/src/dart2jslib.dart"; |
9 import 'package:compiler/implementation/source_file.dart'; | 9 import 'package:compiler/src/source_file.dart'; |
10 import "mock_compiler.dart"; | 10 import "mock_compiler.dart"; |
11 import 'package:compiler/implementation/js_backend/js_backend.dart'; | 11 import 'package:compiler/src/js_backend/js_backend.dart'; |
12 | 12 |
13 Future<CodeBuffer> compileAll(SourceFile sourceFile) { | 13 Future<CodeBuffer> compileAll(SourceFile sourceFile) { |
14 MockCompiler compiler = new MockCompiler.internal(); | 14 MockCompiler compiler = new MockCompiler.internal(); |
15 Uri uri = new Uri(path: sourceFile.filename); | 15 Uri uri = new Uri(path: sourceFile.filename); |
16 compiler.sourceFiles[uri.toString()] = sourceFile; | 16 compiler.sourceFiles[uri.toString()] = sourceFile; |
17 JavaScriptBackend backend = compiler.backend; | 17 JavaScriptBackend backend = compiler.backend; |
18 return compiler.runCompiler(uri).then((_) { | 18 return compiler.runCompiler(uri).then((_) { |
19 return backend.emitter.oldEmitter.mainBuffer; | 19 return backend.emitter.oldEmitter.mainBuffer; |
20 }); | 20 }); |
21 } | 21 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 testSourceMapLocations(FUNCTIONS_TEST); | 103 testSourceMapLocations(FUNCTIONS_TEST); |
104 testSourceMapLocations(RETURN_TEST); | 104 testSourceMapLocations(RETURN_TEST); |
105 testSourceMapLocations(NOT_TEST); | 105 testSourceMapLocations(NOT_TEST); |
106 testSourceMapLocations(UNARY_TEST); | 106 testSourceMapLocations(UNARY_TEST); |
107 testSourceMapLocations(BINARY_TEST); | 107 testSourceMapLocations(BINARY_TEST); |
108 testSourceMapLocations(SEND_TEST); | 108 testSourceMapLocations(SEND_TEST); |
109 testSourceMapLocations(SEND_SET_TEST); | 109 testSourceMapLocations(SEND_SET_TEST); |
110 testSourceMapLocations(LOOP_TEST); | 110 testSourceMapLocations(LOOP_TEST); |
111 testSourceMapLocations(INTERCEPTOR_TEST); | 111 testSourceMapLocations(INTERCEPTOR_TEST); |
112 } | 112 } |
OLD | NEW |