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

Side by Side Diff: sdk/lib/html/templates/html/dart2js/factoryprovider_MutationObserver.darttemplate

Issue 11611009: Forbid arguments to functions with 'native' bodies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 @Creates('MutationObserver') 1 static MutationObserver _create(MutationCallback callback) {
2 @Creates('MutationRecord') 2 // Dummy statement to mark types as instantiated.
3 static MutationObserver _create(MutationCallback callback) native ''' 3 JS('MutationObserver|MutationRecord', '0');
4 var constructor =
5 window.MutationObserver || window.WebKitMutationObserver ||
6 window.MozMutationObserver;
7 return new constructor(callback);
8 ''';
9 4
10 // TODO(sra): Dart2js inserts a conversion when a Dart function (i.e. an 5 return JS('MutationObserver',
11 // object with a call method) is passed to a native method. This is so the 6 'new(window.MutationObserver||window.WebKitMutationObserver||'
12 // native code sees a JavaScript function. 7 'window.MozMutationObserver)(#)',
13 // 8 convertDartClosureToJS(callback, 2));
14 // This does not happen when a function is 'passed' to a JS-form so it is not 9 }
15 // possible to rewrite the above code to, e.g. (simplified):
16 //
17 // static createMutationObserver(MutationCallback callback) =>
18 // JS('var', 'new (window.MutationObserver)(#)', callback);
OLDNEW
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tests/compiler/dart2js_native/native_named_constructors2_frog_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698