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

Unified Diff: sdk/lib/_internal/lib/js_helper.dart

Issue 25325004: Implementing CustomElement's attributeChanged callback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « pkg/custom_element/lib/custom-elements.min.js ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/js_helper.dart
diff --git a/sdk/lib/_internal/lib/js_helper.dart b/sdk/lib/_internal/lib/js_helper.dart
index ddeb666771caa7e66c829eeb757321952dcc4120..c9cf0d1cfcd3166471b1f95b02885aca63a907b5 100644
--- a/sdk/lib/_internal/lib/js_helper.dart
+++ b/sdk/lib/_internal/lib/js_helper.dart
@@ -1498,13 +1498,19 @@ invokeClosure(Function closure,
var isolate,
int numberOfArguments,
var arg1,
- var arg2) {
+ var arg2,
+ var arg3,
+ var arg4) {
if (numberOfArguments == 0) {
return JS_CALL_IN_ISOLATE(isolate, () => closure());
} else if (numberOfArguments == 1) {
return JS_CALL_IN_ISOLATE(isolate, () => closure(arg1));
} else if (numberOfArguments == 2) {
return JS_CALL_IN_ISOLATE(isolate, () => closure(arg1, arg2));
+ } else if (numberOfArguments == 3) {
+ return JS_CALL_IN_ISOLATE(isolate, () => closure(arg1, arg2, arg3));
+ } else if (numberOfArguments == 4) {
+ return JS_CALL_IN_ISOLATE(isolate, () => closure(arg1, arg2, arg3, arg4));
} else {
throw new Exception(
'Unsupported number of arguments for wrapped closure');
@@ -1523,9 +1529,11 @@ convertDartClosureToJS(closure, int arity) {
// We use $0 and $1 to not clash with variable names used by the
// compiler and/or minifier.
function = JS('var',
- r'(function ($2, $3) {'
- r' return function($0, $1) { '
- r'return $3(#, $2, #, $0, $1) }})(#, #)',
+ '(function(closure, arity, context, invoke) {'
+ ' return function(a1, a2, a3, a4) {'
+ ' return invoke(closure, context, arity, a1, a2, a3, a4);'
+ ' };'
+ '})(#,#,#,#)',
closure,
arity,
// Capture the current isolate now. Remember that "#"
« no previous file with comments | « pkg/custom_element/lib/custom-elements.min.js ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698