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

Unified Diff: lib/html/templates/html/impl/impl_Element.darttemplate

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/templates/html/impl/impl_Element.darttemplate
diff --git a/lib/html/templates/html/impl/impl_Element.darttemplate b/lib/html/templates/html/impl/impl_Element.darttemplate
index 7e0732c021149ea959b39111d0da79a1566ae63c..01544daa3342bf9bdfeba471a1c56fc00a4a80b8 100644
--- a/lib/html/templates/html/impl/impl_Element.darttemplate
+++ b/lib/html/templates/html/impl/impl_Element.darttemplate
@@ -743,7 +743,7 @@ $endif
$if DART2JS
/** @domName Element.insertAdjacentText */
void insertAdjacentText(String where, String text) {
- if (JS('bool', '!!this.insertAdjacentText')) {
+ if (JS('bool', '!!#.insertAdjacentText', this)) {
_insertAdjacentText(where, text);
} else {
_insertAdjacentNode(where, new Text(text));
@@ -755,7 +755,7 @@ $if DART2JS
/** @domName Element.insertAdjacentHTML */
void insertAdjacentHTML(String where, String text) {
- if (JS('bool', '!!this.insertAdjacentHTML')) {
+ if (JS('bool', '!!#.insertAdjacentHTML', this)) {
_insertAdjacentHTML(where, text);
} else {
_insertAdjacentNode(where, new DocumentFragment.html(text));
@@ -767,7 +767,7 @@ $if DART2JS
/** @domName Element.insertAdjacentHTML */
Element insertAdjacentElement(String where, Element element) {
- if (JS('bool', '!!this.insertAdjacentElement')) {
+ if (JS('bool', '!!#.insertAdjacentElement', this)) {
_insertAdjacentElement(where, element);
} else {
_insertAdjacentNode(where, element);
@@ -862,8 +862,8 @@ class _ElementFactoryProvider {
$if DART2JS
// Optimization to improve performance until the dart2js compiler inlines this
// method.
- static Element createElement_tag(String tag)
- native "return document.createElement(tag)";
+ static Element createElement_tag(String tag) =>
+ JS('Element', 'document.createElement(#)', tag);
$else
static Element createElement_tag(String tag) =>
_document.$dom_createElement(tag);

Powered by Google App Engine
This is Rietveld 408576698