| 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 dart2js.source_information; | 5 library dart2js.source_information; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' show Location; | 7 import 'package:kernel/ast.dart' show Location; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../elements/elements.dart' | 9 import '../elements/elements.dart' |
| 10 show | 10 show |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 String toString() => '${sourceUri}:[${line},${column}]'; | 194 String toString() => '${sourceUri}:[${line},${column}]'; |
| 195 } | 195 } |
| 196 | 196 |
| 197 /// A location in a source file. | 197 /// A location in a source file. |
| 198 abstract class AbstractSourceLocation extends SourceLocation { | 198 abstract class AbstractSourceLocation extends SourceLocation { |
| 199 final SourceFile _sourceFile; | 199 final SourceFile _sourceFile; |
| 200 Location _location; | 200 Location _location; |
| 201 | 201 |
| 202 AbstractSourceLocation(this._sourceFile) { | 202 AbstractSourceLocation(this._sourceFile) { |
| 203 assert(invariant(new SourceSpan(sourceUri, 0, 0), isValid, | 203 assert( |
| 204 message: "Invalid source location in ${sourceUri}: " | 204 isValid, |
| 205 failedAt( |
| 206 new SourceSpan(sourceUri, 0, 0), |
| 207 "Invalid source location in ${sourceUri}: " |
| 205 "offset=$offset, length=${_sourceFile.length}.")); | 208 "offset=$offset, length=${_sourceFile.length}.")); |
| 206 } | 209 } |
| 207 | 210 |
| 208 /// The absolute URI of the source file of this source location. | 211 /// The absolute URI of the source file of this source location. |
| 209 Uri get sourceUri => _sourceFile.uri; | 212 Uri get sourceUri => _sourceFile.uri; |
| 210 | 213 |
| 211 /// The character offset of the this source location into the source file. | 214 /// The character offset of the this source location into the source file. |
| 212 int get offset; | 215 int get offset; |
| 213 | 216 |
| 214 /// The 1-based line number of the [offset]. | 217 /// The 1-based line number of the [offset]. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 @override | 319 @override |
| 317 int get line => null; | 320 int get line => null; |
| 318 | 321 |
| 319 @override | 322 @override |
| 320 int get offset => null; | 323 int get offset => null; |
| 321 | 324 |
| 322 String get shortName => '<no-location>'; | 325 String get shortName => '<no-location>'; |
| 323 | 326 |
| 324 String toString() => '<no-location>'; | 327 String toString() => '<no-location>'; |
| 325 } | 328 } |
| OLD | NEW |