OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:math"; | 5 import "dart:math"; |
6 import "dart:typed_data"; | 6 import "dart:typed_data"; |
7 | 7 |
8 // Equivalent of calling FATAL from C++ code. | 8 // Equivalent of calling FATAL from C++ code. |
9 _fatal(msg) native "DartCore_fatal"; | 9 _fatal(msg) native "DartCore_fatal"; |
10 | 10 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 if (isYieldEach) { | 198 if (isYieldEach) { |
199 // Spec mandates: it is a dynamic error if the class of [the object | 199 // Spec mandates: it is a dynamic error if the class of [the object |
200 // returned by yield*] does not implement Iterable. | 200 // returned by yield*] does not implement Iterable. |
201 yieldEachIterator = (current as Iterable).iterator; | 201 yieldEachIterator = (current as Iterable).iterator; |
202 continue; | 202 continue; |
203 } | 203 } |
204 return true; | 204 return true; |
205 } | 205 } |
206 } | 206 } |
207 } | 207 } |
| 208 |
| 209 patch class Resource { |
| 210 /* patch */ const factory Resource(String uri) = _Resource; |
| 211 } |
| 212 |
| 213 class _Resource implements Resource { |
| 214 final String _location; |
| 215 |
| 216 const _Resource(String uri) : _location = uri; |
| 217 |
| 218 Uri get uri => Uri.base.resolve(_location); |
| 219 |
| 220 Stream<List<int>> openRead() { |
| 221 throw new UnimplementedError("openRead"); |
| 222 } |
| 223 |
| 224 Future<List<int>> readAsBytes() { |
| 225 throw new UnimplementedError("readAsBytes"); |
| 226 } |
| 227 |
| 228 Future<String> readAsString({Encoding encoding}) { |
| 229 throw new UnimplementedError("readAsString"); |
| 230 } |
| 231 } |
OLD | NEW |