OLD | NEW |
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; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 extends JavaScriptSourceInformationStrategy { | 193 extends JavaScriptSourceInformationStrategy { |
194 final JavaScriptSourceInformationStrategy strategy; | 194 final JavaScriptSourceInformationStrategy strategy; |
195 final Map<RecordedSourceInformationProcess, js.Node> processMap = | 195 final Map<RecordedSourceInformationProcess, js.Node> processMap = |
196 <RecordedSourceInformationProcess, js.Node>{}; | 196 <RecordedSourceInformationProcess, js.Node>{}; |
197 final Map<js.Node, RecordedSourceInformationProcess> nodeMap = | 197 final Map<js.Node, RecordedSourceInformationProcess> nodeMap = |
198 <js.Node, RecordedSourceInformationProcess>{}; | 198 <js.Node, RecordedSourceInformationProcess>{}; |
199 | 199 |
200 RecordingSourceInformationStrategy(this.strategy); | 200 RecordingSourceInformationStrategy(this.strategy); |
201 | 201 |
202 @override | 202 @override |
203 SourceInformationBuilder createBuilderForContext(AstElement element) { | 203 SourceInformationBuilder createBuilderForContext(ResolvedAst resolvedAst) { |
204 return strategy.createBuilderForContext(element); | 204 return strategy.createBuilderForContext(resolvedAst); |
205 } | 205 } |
206 | 206 |
207 @override | 207 @override |
208 SourceInformationProcessor createProcessor(SourceMapper sourceMapper) { | 208 SourceInformationProcessor createProcessor(SourceMapper sourceMapper) { |
209 LocationMap nodeToSourceLocationsMap = | 209 LocationMap nodeToSourceLocationsMap = |
210 new _LocationRecorder(); | 210 new _LocationRecorder(); |
211 CodePositionRecorder codePositions = new CodePositionRecorder(); | 211 CodePositionRecorder codePositions = new CodePositionRecorder(); |
212 return new RecordingSourceInformationProcessor( | 212 return new RecordingSourceInformationProcessor( |
213 this, | 213 this, |
214 strategy.createProcessor(new RecordingSourceMapper( | 214 strategy.createProcessor(new RecordingSourceMapper( |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 absoluteUri = base.resolveUri(uri); | 589 absoluteUri = base.resolveUri(uri); |
590 } else { | 590 } else { |
591 absoluteUri = base.resolve(uri); | 591 absoluteUri = base.resolve(uri); |
592 } | 592 } |
593 return sourceFiles.putIfAbsent(absoluteUri, () { | 593 return sourceFiles.putIfAbsent(absoluteUri, () { |
594 String text = new File.fromUri(absoluteUri).readAsStringSync(); | 594 String text = new File.fromUri(absoluteUri).readAsStringSync(); |
595 return new StringSourceFile.fromUri(absoluteUri, text); | 595 return new StringSourceFile.fromUri(absoluteUri, text); |
596 }); | 596 }); |
597 } | 597 } |
598 } | 598 } |
OLD | NEW |