| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.io.source_file; | 5 library dart2js.io.source_file; |
| 6 | 6 |
| 7 import 'dart:convert' show UTF8; |
| 7 import 'dart:math'; | 8 import 'dart:math'; |
| 8 import 'dart:convert' show UTF8; | |
| 9 import 'dart:typed_data' show Uint8List; | 9 import 'dart:typed_data' show Uint8List; |
| 10 | 10 |
| 11 import 'line_column_provider.dart'; | 11 import 'line_column_provider.dart'; |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Represents a file of source code. The content can be either a [String] or | 14 * Represents a file of source code. The content can be either a [String] or |
| 15 * a UTF-8 encoded [List<int>] of bytes. | 15 * a UTF-8 encoded [List<int>] of bytes. |
| 16 */ | 16 */ |
| 17 abstract class SourceFile implements LineColumnProvider { | 17 abstract class SourceFile implements LineColumnProvider { |
| 18 /// The absolute URI of the source file. | 18 /// The absolute URI of the source file. |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 set length(int v) {} | 285 set length(int v) {} |
| 286 | 286 |
| 287 String slowText() => text; | 287 String slowText() => text; |
| 288 | 288 |
| 289 List<int> slowUtf8ZeroTerminatedBytes() { | 289 List<int> slowUtf8ZeroTerminatedBytes() { |
| 290 return _zeroTerminateIfNecessary(UTF8.encode(text)); | 290 return _zeroTerminateIfNecessary(UTF8.encode(text)); |
| 291 } | 291 } |
| 292 | 292 |
| 293 String slowSubstring(int start, int end) => text.substring(start, end); | 293 String slowSubstring(int start, int end) => text.substring(start, end); |
| 294 } | 294 } |
| OLD | NEW |