| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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:io'; | 5 import 'dart:io'; |
| 6 import 'dart:convert'; | 6 import 'dart:convert'; |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:path/path.dart' as path; | 9 import 'package:path/path.dart' as path; |
| 10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 (entry.sourceLine == otherEntry.sourceLine) && | 169 (entry.sourceLine == otherEntry.sourceLine) && |
| 170 (entry.sourceColumn == otherEntry.sourceColumn) && | 170 (entry.sourceColumn == otherEntry.sourceColumn) && |
| 171 (entry.sourceNameId == otherEntry.sourceNameId); | 171 (entry.sourceNameId == otherEntry.sourceNameId); |
| 172 } | 172 } |
| 173 | 173 |
| 174 Uri getMapUri(Uri targetUri) { | 174 Uri getMapUri(Uri targetUri) { |
| 175 print('Accessing $targetUri'); | 175 print('Accessing $targetUri'); |
| 176 File targetFile = new File.fromUri(targetUri); | 176 File targetFile = new File.fromUri(targetUri); |
| 177 Expect.isTrue(targetFile.existsSync()); | 177 Expect.isTrue(targetFile.existsSync()); |
| 178 List<String> target = targetFile.readAsStringSync().split('\n'); | 178 List<String> target = targetFile.readAsStringSync().split('\n'); |
| 179 String mapReference = target[target.length - 3]; // #sourceMappingURL=<url> | 179 String mapReference = target[target.length - 2]; // #sourceMappingURL=<url> |
| 180 Expect.isTrue(mapReference.startsWith('//# sourceMappingURL=')); | 180 Expect.isTrue(mapReference.startsWith('//# sourceMappingURL=')); |
| 181 String mapName = mapReference.substring(mapReference.indexOf('=') + 1); | 181 String mapName = mapReference.substring(mapReference.indexOf('=') + 1); |
| 182 return targetUri.resolve(mapName); | 182 return targetUri.resolve(mapName); |
| 183 } | 183 } |
| 184 | 184 |
| 185 SingleMapping getSourceMap(Uri mapUri) { | 185 SingleMapping getSourceMap(Uri mapUri) { |
| 186 print('Accessing $mapUri'); | 186 print('Accessing $mapUri'); |
| 187 File mapFile = new File.fromUri(mapUri); | 187 File mapFile = new File.fromUri(mapUri); |
| 188 Expect.isTrue(mapFile.existsSync()); | 188 Expect.isTrue(mapFile.existsSync()); |
| 189 return new SingleMapping.fromJson( | 189 return new SingleMapping.fromJson( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 final Position end; | 231 final Position end; |
| 232 | 232 |
| 233 Interval(this.begin, this.end); | 233 Interval(this.begin, this.end); |
| 234 | 234 |
| 235 bool contains(Position other) { | 235 bool contains(Position other) { |
| 236 return begin <= other && other <= end; | 236 return begin <= other && other <= end; |
| 237 } | 237 } |
| 238 | 238 |
| 239 String toString() => '$begin-$end'; | 239 String toString() => '$begin-$end'; |
| 240 } | 240 } |
| OLD | NEW |