| 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 'package:compiler/src/apiimpl.dart' as api; | 8 import 'package:compiler/src/apiimpl.dart' as api; |
| 9 import 'package:compiler/src/dart2jslib.dart' show NullSink; | 9 import 'package:compiler/src/dart2jslib.dart' show NullSink; |
| 10 import 'package:compiler/src/elements/elements.dart'; | 10 import 'package:compiler/src/elements/elements.dart'; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 codePoints.add(new CodePoint(kind, jsCode, sourceLocation, | 246 codePoints.add(new CodePoint(kind, jsCode, sourceLocation, |
| 247 dartCodeFromSourceLocation(sourceLocation))); | 247 dartCodeFromSourceLocation(sourceLocation))); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 Map<int, List<SourceLocation>> locationMap = nodeMap[node]; | 251 Map<int, List<SourceLocation>> locationMap = nodeMap[node]; |
| 252 if (locationMap == null) { | 252 if (locationMap == null) { |
| 253 addLocation(null, nodeToString(node)); | 253 addLocation(null, nodeToString(node)); |
| 254 } else { | 254 } else { |
| 255 locationMap.forEach((int targetOffset, List<SourceLocation> locations) { | 255 locationMap.forEach((int targetOffset, List<SourceLocation> locations) { |
| 256 String jsCode = positionToString(targetOffset); | 256 String jsCode = nodeToString(node); |
| 257 for (SourceLocation location in locations) { | 257 for (SourceLocation location in locations) { |
| 258 addLocation(location, jsCode); | 258 addLocation(location, jsCode); |
| 259 } | 259 } |
| 260 }); | 260 }); |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 | 263 |
| 264 void apply(js.Node node) { | 264 void apply(js.Node node) { |
| 265 node.accept(this); | 265 node.accept(this); |
| 266 } | 266 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 this.jsCode, | 326 this.jsCode, |
| 327 this.sourceLocation, | 327 this.sourceLocation, |
| 328 this.dartCode, | 328 this.dartCode, |
| 329 {this.isMissing: false}); | 329 {this.isMissing: false}); |
| 330 | 330 |
| 331 String toString() { | 331 String toString() { |
| 332 return 'CodePoint[kind=$kind,js=$jsCode,dart=$dartCode,' | 332 return 'CodePoint[kind=$kind,js=$jsCode,dart=$dartCode,' |
| 333 'location=$sourceLocation]'; | 333 'location=$sourceLocation]'; |
| 334 } | 334 } |
| 335 } | 335 } |
| OLD | NEW |