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

Unified Diff: tools/dom/src/dart2js_LocationWrapper.dart

Issue 14646032: Fixing Location.origin to work on non-WebKit browsers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/templates/html/impl/impl_Location.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/dart2js_LocationWrapper.dart
diff --git a/tools/dom/src/dart2js_LocationWrapper.dart b/tools/dom/src/dart2js_LocationWrapper.dart
index f430534da8cbc8bd45a81ca6f960f229b0718c9f..c943226f4d170258a3df2020d1dfff5cf2f60c45 100644
--- a/tools/dom/src/dart2js_LocationWrapper.dart
+++ b/tools/dom/src/dart2js_LocationWrapper.dart
@@ -44,7 +44,12 @@ class _LocationWrapper implements Location {
}
// final String origin;
- String get origin => _get(_ptr, 'origin');
+ String get origin {
+ if (JS('bool', '("origin" in #)', _ptr)) {
+ return JS('String', '#.origin', _ptr);
+ }
+ return '${this.protocol}//${this.host}';
+ }
// String pathname;
String get pathname => _get(_ptr, 'pathname');
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/templates/html/impl/impl_Location.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698