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

Unified Diff: tools/dom/templates/html/impl/impl_Window.darttemplate

Issue 233793002: Remove _LocationWrapper (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/templates/html/dart2js/html_dart2js.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Window.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
index cdf44bf52b634cc11e86f6e4bbe3e1453b7c0d58..94baa467c071804832849ae3fd61dae297959f80 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -70,59 +70,29 @@ $if DART2JS
}
// API level getter and setter for Location.
- // TODO: The cross domain safe wrapper can be inserted here or folded into
- // _LocationWrapper.
+ // TODO: The cross domain safe wrapper can be inserted here.
/**
* The current location of this window.
*
* Location currentLocation = window.location;
* print(currentLocation.href); // 'http://www.example.com:80/'
*/
- Location get location {
- // Firefox work-around for Location. The Firefox location object cannot be
- // made to behave like a Dart object so must be wrapped.
- var result = _location;
- if (_isDartLocation(result)) return result; // e.g. on Chrome.
- if (null == _location_wrapper) {
- _location_wrapper = new _LocationWrapper(result);
- }
- return _location_wrapper;
- }
+ Location get location => _location;
// TODO: consider forcing users to do: window.location.assign('string').
/**
* Sets the window's location, which causes the browser to navigate to the new
- * location. [value] may be a Location object or a string.
+ * location. [value] may be a Location object or a String.
*/
void set location(value) {
- if (value is _LocationWrapper) {
- _location = value._ptr;
- } else {
- _location = value;
- }
+ _location = value;
}
- _LocationWrapper _location_wrapper; // Cached wrapped Location object.
-
// Native getter and setter to access raw Location object.
- dynamic get _location => JS('Location|=Object', '#.location', this);
+ dynamic get _location => JS('Location|Null', '#.location', this);
void set _location(value) {
JS('void', '#.location = #', this, value);
}
- // Prevent compiled from thinking 'location' property is available for a Dart
- // member.
- @JSName('location')
- _protect_location() native;
-
- static _isDartLocation(thing) {
- // On Firefox the code that implements 'is Location' fails to find the patch
- // stub on Object.prototype and throws an exception.
- try {
- return thing is Location;
- } catch (e) {
- return false;
- }
- }
/**
* Called to draw an animation frame and then request the window to repaint
« no previous file with comments | « tools/dom/templates/html/dart2js/html_dart2js.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698