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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.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 | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 52c198598cee408df88fd00699cab51851bfd155..bd7050c6cb21ffedd808679f86404afab9253c29 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -12885,7 +12885,7 @@ class LocalMediaStream extends MediaStream implements EventTarget native "LocalM
@DocsEditable
void stop() native;
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -12916,10 +12916,6 @@ class Location implements LocationBase native "Location" {
@DocsEditable
String href;
- @DomName('Location.origin')
- @DocsEditable
- final String origin;
-
@DomName('Location.pathname')
@DocsEditable
String pathname;
@@ -12955,6 +12951,15 @@ class Location implements LocationBase native "Location" {
@DomName('Location.valueOf')
@DocsEditable
Object valueOf() native;
+
+
+ @DomName('Location.origin')
+ String get origin {
+ if (JS('bool', '("origin" in #)', this)) {
+ return JS('String', '#.origin', this);
+ }
+ return '${this.protocol}//${this.host}';
+ }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -29445,7 +29450,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 | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698