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

Unified Diff: sdk/lib/_internal/lib/js_helper.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/js_helper.dart
diff --git a/sdk/lib/_internal/lib/js_helper.dart b/sdk/lib/_internal/lib/js_helper.dart
index f31a0b813d18ffb5e1804937a215af995947381d..388673a39218929583678f5036700457001aec8e 100644
--- a/sdk/lib/_internal/lib/js_helper.dart
+++ b/sdk/lib/_internal/lib/js_helper.dart
@@ -470,6 +470,14 @@ class Primitives {
return 1000 * dateNow();
}
+ static String currentUri() {
+ // In a browser return window.location.href.
+ if (JS('bool', 'typeof window != "undefined" && window !== null')) {
+ return JS('String', 'window.location.href');
+ }
+ return null;
+ }
+
// This is to avoid stack overflows due to very large argument arrays in
// apply(). It fixes http://dartbug.com/6919
static String _fromCharCodeApply(List<int> array) {

Powered by Google App Engine
This is Rietveld 408576698