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

Unified Diff: sdk/lib/_internal/lib/core_patch.dart

Issue 23686021: Add property base to the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ahe@ Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/lib/core_patch.dart
diff --git a/sdk/lib/_internal/lib/core_patch.dart b/sdk/lib/_internal/lib/core_patch.dart
index aaa816442dc320e3b21552d9f60f39a1e1f26b10..711a607215dcee2d39af5fc2f4c4bdf363d6ae3b 100644
--- a/sdk/lib/_internal/lib/core_patch.dart
+++ b/sdk/lib/_internal/lib/core_patch.dart
@@ -3,13 +3,13 @@
// BSD-style license that can be found in the LICENSE file.
// Patch file for dart:core classes.
+import "dart:_collection-dev" as _symbol_dev;
import 'dart:_interceptors';
import 'dart:_js_helper' show checkNull,
getRuntimeType,
JSSyntaxRegExp,
Primitives,
stringJoinUnchecked;
-import "dart:_collection-dev" as _symbol_dev;
String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
@@ -311,4 +311,10 @@ patch class NoSuchMethodError {
patch class Uri {
patch static bool get _isWindows => false;
+
+ patch static Uri get base {
+ String uri = Primitives.currentUri();
+ if (uri != null) return Uri.parse(uri);
+ throw new UnsupportedError("No base URI available on this platform");
+ }
}

Powered by Google App Engine
This is Rietveld 408576698