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

Unified Diff: lib/html/src/dart2js_LocationWrapper.dart

Issue 11094082: Convert legacy 'native code' to JS-forms in dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 8 years, 2 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: lib/html/src/dart2js_LocationWrapper.dart
diff --git a/lib/html/src/dart2js_LocationWrapper.dart b/lib/html/src/dart2js_LocationWrapper.dart
index e6433d65eeb1a6ddac723bbf0f68dc6645079a46..6401a6da9f9dfb948516edb96e97439aaf8562d2 100644
--- a/lib/html/src/dart2js_LocationWrapper.dart
+++ b/lib/html/src/dart2js_LocationWrapper.dart
@@ -54,20 +54,15 @@ class _LocationWrapper implements LocalLocation {
void set search(String value) => _set(_ptr, 'search', value);
- void assign(String url) => _assign(_ptr, url);
+ void assign(String url) => JS('void', '#.assign(#)', _ptr, url);
- void reload() => _reload(_ptr);
+ void reload() => JS('void', '#.reload()', _ptr);
- void replace(String url) => _replace(_ptr, url);
+ void replace(String url) => JS('void', '#.replace(#)', _ptr, url);
- String toString() => _toString(_ptr);
+ String toString() => JS('String', '#.toString()', _ptr);
- static _get(p, m) native 'return p[m];';
- static _set(p, m, v) native 'p[m] = v;';
-
- static _assign(p, url) native 'p.assign(url);';
- static _reload(p) native 'p.reload()';
- static _replace(p, url) native 'p.replace(url);';
- static _toString(p) native 'return p.toString();';
+ static _get(p, m) => JS('var', '#[#]', p, m);
+ static _set(p, m, v) => JS('void', '#[#] = #', p, m, v);
}
« no previous file with comments | « lib/html/src/dart2js_IDBKeyRangeFactoryProvider.dart ('k') | lib/html/src/dart2js_MutationObserverSupported.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698