Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: tests/compiler/dart2js/source_mapping_test.dart

Issue 1226733010: dart2js: Remove oldEmitter field in emitter-task. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/compiler/dart2js/mirrors_used_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/src/io/code_output.dart"; 8 import "package:compiler/src/io/code_output.dart";
9 import 'package:compiler/src/io/source_file.dart'; 9 import 'package:compiler/src/io/source_file.dart';
10 import 'package:compiler/src/io/source_information.dart'; 10 import 'package:compiler/src/io/source_information.dart';
11 import "mock_compiler.dart"; 11 import "mock_compiler.dart";
12 import 'package:compiler/src/js_backend/js_backend.dart'; 12 import 'package:compiler/src/js_backend/js_backend.dart';
13 import 'package:compiler/src/js_emitter/js_emitter.dart';
13 14
14 Future<CodeBuffer> compileAll(SourceFile sourceFile) { 15 Future<CodeBuffer> compileAll(SourceFile sourceFile) {
15 MockCompiler compiler = new MockCompiler.internal(); 16 MockCompiler compiler = new MockCompiler.internal();
16 Uri uri = new Uri(path: sourceFile.filename); 17 Uri uri = new Uri(path: sourceFile.filename);
17 compiler.sourceFiles[uri.toString()] = sourceFile; 18 compiler.sourceFiles[uri.toString()] = sourceFile;
18 JavaScriptBackend backend = compiler.backend; 19 JavaScriptBackend backend = compiler.backend;
19 return compiler.runCompiler(uri).then((_) { 20 return compiler.runCompiler(uri).then((_) {
20 return backend.emitter.oldEmitter 21 // TODO(floitsch): the outputBuffers are only accessible in the full
22 // emitter.
23 OldEmitter fullEmitter = backend.emitter.emitter;
24 return fullEmitter
21 .outputBuffers[compiler.deferredLoadTask.mainOutputUnit]; 25 .outputBuffers[compiler.deferredLoadTask.mainOutputUnit];
22 }); 26 });
23 } 27 }
24 28
25 void testSourceMapLocations(String codeWithMarkers) { 29 void testSourceMapLocations(String codeWithMarkers) {
26 List<int> expectedLocations = new List<int>(); 30 List<int> expectedLocations = new List<int>();
27 for (int i = 0; i < codeWithMarkers.length; ++i) { 31 for (int i = 0; i < codeWithMarkers.length; ++i) {
28 if (codeWithMarkers[i] == '@') { 32 if (codeWithMarkers[i] == '@') {
29 expectedLocations.add(i - expectedLocations.length); 33 expectedLocations.add(i - expectedLocations.length);
30 } 34 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 testSourceMapLocations(FUNCTIONS_TEST); 110 testSourceMapLocations(FUNCTIONS_TEST);
107 testSourceMapLocations(RETURN_TEST); 111 testSourceMapLocations(RETURN_TEST);
108 testSourceMapLocations(NOT_TEST); 112 testSourceMapLocations(NOT_TEST);
109 testSourceMapLocations(UNARY_TEST); 113 testSourceMapLocations(UNARY_TEST);
110 testSourceMapLocations(BINARY_TEST); 114 testSourceMapLocations(BINARY_TEST);
111 testSourceMapLocations(SEND_TEST); 115 testSourceMapLocations(SEND_TEST);
112 testSourceMapLocations(SEND_SET_TEST); 116 testSourceMapLocations(SEND_SET_TEST);
113 testSourceMapLocations(LOOP_TEST); 117 testSourceMapLocations(LOOP_TEST);
114 testSourceMapLocations(INTERCEPTOR_TEST); 118 testSourceMapLocations(INTERCEPTOR_TEST);
115 } 119 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mirrors_used_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698