Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Side by Side Diff: runtime/lib/core_patch.dart

Issue 1181663002: Add Resource class. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add suppression for analyzer warnings. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/pkg.status ('k') | runtime/lib/internal_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « pkg/pkg.status ('k') | runtime/lib/internal_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698