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

Side by Side Diff: tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart

Issue 2897273002: Add FunctionEntity.asyncMarker and refactor SourceInformationStrategy to avoid ResolvedAst (Closed)
Patch Set: Created 3 years, 7 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 | « pkg/compiler/lib/src/typechecker.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library sourcemap.helper; 5 library sourcemap.helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'package:compiler/compiler_new.dart'; 9 import 'package:compiler/compiler_new.dart';
10 import 'package:compiler/src/apiimpl.dart' as api; 10 import 'package:compiler/src/apiimpl.dart' as api;
11 import 'package:compiler/src/commandline_options.dart'; 11 import 'package:compiler/src/commandline_options.dart';
12 import 'package:compiler/src/null_compiler_output.dart' show NullSink; 12 import 'package:compiler/src/null_compiler_output.dart' show NullSink;
13 import 'package:compiler/src/elements/elements.dart'; 13 import 'package:compiler/src/elements/elements.dart';
14 import 'package:compiler/src/elements/entities.dart';
14 import 'package:compiler/src/helpers/helpers.dart'; 15 import 'package:compiler/src/helpers/helpers.dart';
15 import 'package:compiler/src/filenames.dart'; 16 import 'package:compiler/src/filenames.dart';
16 import 'package:compiler/src/io/code_output.dart'; 17 import 'package:compiler/src/io/code_output.dart';
17 import 'package:compiler/src/io/source_file.dart'; 18 import 'package:compiler/src/io/source_file.dart';
18 import 'package:compiler/src/io/source_information.dart'; 19 import 'package:compiler/src/io/source_information.dart';
19 import 'package:compiler/src/io/position_information.dart'; 20 import 'package:compiler/src/io/position_information.dart';
20 import 'package:compiler/src/js/js.dart' as js; 21 import 'package:compiler/src/js/js.dart' as js;
21 import 'package:compiler/src/js/js_debug.dart'; 22 import 'package:compiler/src/js/js_debug.dart';
22 import 'package:compiler/src/js/js_source_mapping.dart'; 23 import 'package:compiler/src/js/js_source_mapping.dart';
23 import 'package:compiler/src/js_backend/js_backend.dart'; 24 import 'package:compiler/src/js_backend/js_backend.dart';
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 extends JavaScriptSourceInformationStrategy { 194 extends JavaScriptSourceInformationStrategy {
194 final JavaScriptSourceInformationStrategy strategy; 195 final JavaScriptSourceInformationStrategy strategy;
195 final Map<RecordedSourceInformationProcess, js.Node> processMap = 196 final Map<RecordedSourceInformationProcess, js.Node> processMap =
196 <RecordedSourceInformationProcess, js.Node>{}; 197 <RecordedSourceInformationProcess, js.Node>{};
197 final Map<js.Node, RecordedSourceInformationProcess> nodeMap = 198 final Map<js.Node, RecordedSourceInformationProcess> nodeMap =
198 <js.Node, RecordedSourceInformationProcess>{}; 199 <js.Node, RecordedSourceInformationProcess>{};
199 200
200 RecordingSourceInformationStrategy(this.strategy); 201 RecordingSourceInformationStrategy(this.strategy);
201 202
202 @override 203 @override
203 SourceInformationBuilder createBuilderForContext(ResolvedAst resolvedAst) { 204 SourceInformationBuilder createBuilderForContext(MemberEntity member) {
204 return strategy.createBuilderForContext(resolvedAst); 205 return strategy.createBuilderForContext(member);
205 } 206 }
206 207
207 @override 208 @override
208 SourceInformationProcessor createProcessor( 209 SourceInformationProcessor createProcessor(
209 SourceMapperProvider provider, SourceInformationReader reader) { 210 SourceMapperProvider provider, SourceInformationReader reader) {
210 LocationMap nodeToSourceLocationsMap = new _LocationRecorder(); 211 LocationMap nodeToSourceLocationsMap = new _LocationRecorder();
211 CodePositionRecorder codePositions = new CodePositionRecorder(); 212 CodePositionRecorder codePositions = new CodePositionRecorder();
212 return new RecordingSourceInformationProcessor( 213 return new RecordingSourceInformationProcessor(
213 this, 214 this,
214 strategy.createProcessor( 215 strategy.createProcessor(
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 absoluteUri = base.resolveUri(uri); 572 absoluteUri = base.resolveUri(uri);
572 } else { 573 } else {
573 absoluteUri = base.resolve(uri); 574 absoluteUri = base.resolve(uri);
574 } 575 }
575 return sourceFiles.putIfAbsent(absoluteUri, () { 576 return sourceFiles.putIfAbsent(absoluteUri, () {
576 String text = new File.fromUri(absoluteUri).readAsStringSync(); 577 String text = new File.fromUri(absoluteUri).readAsStringSync();
577 return new StringSourceFile.fromUri(absoluteUri, text); 578 return new StringSourceFile.fromUri(absoluteUri, text);
578 }); 579 });
579 } 580 }
580 } 581 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/typechecker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698