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

Unified Diff: sdk/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate

Issue 11369128: Changes to allow more precise inference of live native classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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: sdk/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
diff --git a/sdk/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate b/sdk/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
index 2583ce802635e83fb12790e6a9ba5d603f0054aa..d92979b3943fa7acc996993f44a2d37b267efef1 100644
--- a/sdk/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
+++ b/sdk/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate
@@ -5,7 +5,20 @@
part of html;
class $FACTORYPROVIDER {
- static $CONSTRUCTOR create$(CONSTRUCTOR)(MutationCallback callback) native '''
+ static $CONSTRUCTOR create$(CONSTRUCTOR)(MutationCallback callback) {
+
+ // This is a hack to cause MutationRecord to appear to be instantiated.
+ //
+ // MutationCallback has a parameter type List<MutationRecord>. From this we
+ // infer a list is created in the browser, but not the element type, because
+ // other native fields and methods return plain List which is too general
+ // and would imply creating anything. This statement is a work-around.
+ JS('MutationRecord','0');
+
+ return _create$(CONSTRUCTOR)(callback);
+ }
+
+ static $CONSTRUCTOR _create$(CONSTRUCTOR)(MutationCallback callback) native '''
var constructor =
window.MutationObserver || window.WebKitMutationObserver ||
window.MozMutationObserver;
« no previous file with comments | « sdk/lib/html/src/dart2js_Conversions.dart ('k') | sdk/lib/html/templates/html/dart2js/impl_LocalWindow.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698