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
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..3012b6861ba7c182d365cbef617ef1d6943aed57 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -70,8 +70,7 @@ $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.
*
@@ -79,50 +78,23 @@ $if DART2JS
* 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;
+ return _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);
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

Powered by Google App Engine
This is Rietveld 408576698