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

Unified Diff: lib/html/templates/html/dart2js/factoryprovider_MutationObserver.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/dart2js/factoryprovider_MutationObserver.darttemplate
diff --git a/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate b/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
index 88d29d6f28c51b4faf3f012310cf67db08c4559d..83ff8c9d7c214250dde4f21280d89a39ba1dd018 100644
--- a/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
+++ b/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
@@ -9,4 +9,14 @@ class $FACTORYPROVIDER {
window.MozMutationObserver;
return new constructor(callback);
''';
+
+ // TODO(sra): Dart2js inserts a conversion when a Dart function (i.e. an
+ // object with a call method) is passed to a native method. This is so the
+ // native code sees a JavaScript function.
+ //
+ // This does not happen when a function is 'passed' to a JS-form so it is not
+ // possible to rewrite the above code to, e.g. (simplified):
+ //
+ // static createMutationObserver(MutationCallback callback) =>
+ // JS('var', 'new (window.MutationObserver)(#)', callback);
}

Powered by Google App Engine
This is Rietveld 408576698