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

Unified Diff: tool/input_sdk/private/js_helper.dart

Issue 1131143002: Angular workarounds (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase onto latest Created 5 years, 7 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 | « tool/input_sdk/private/isolate_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/js_helper.dart
diff --git a/tool/input_sdk/private/js_helper.dart b/tool/input_sdk/private/js_helper.dart
index 0843c5912ebac239ba26d46e4443c1efc93fd80f..e36c37147609e160a50a147cf2e8dead981811ba 100644
--- a/tool/input_sdk/private/js_helper.dart
+++ b/tool/input_sdk/private/js_helper.dart
@@ -754,7 +754,8 @@ class Primitives {
/// In minified mode, uses the unminified names if available.
static String objectToString(Object object) {
- String name = objectTypeName(object);
+ // String name = objectTypeName(object);
+ String name = JS('String', 'dart.typeName(dart.realRuntimeType(#))', object);
return "Instance of '$name'";
}
@@ -1919,28 +1920,12 @@ invokeClosure(Function closure,
* closure when the Dart closure is passed to the DOM.
*/
convertDartClosureToJS(closure, int arity) {
- if (closure == null) return null;
- var function = JS('var', r'#.$identity', closure);
- if (JS('bool', r'!!#', function)) return function;
-
- // We use $0 and $1 to not clash with variable names used by the
- // compiler and/or minifier.
- function = JS('var',
- '(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 "#"
- // in JS is simply textual substitution of compiled
- // expressions.
- JS_CURRENT_ISOLATE_CONTEXT(),
- DART_CLOSURE_TO_JS(invokeClosure));
-
- JS('void', r'#.$identity = #', closure, function);
- return function;
+ // TODO(vsm): Dart2JS wraps closures to:
+ // (a) adjust the calling convention, and
+ // (b) record the source isolate
+ // Do we need either?
+ // See: https://github.com/dart-lang/dev_compiler/issues/164
+ return closure;
}
/**
« no previous file with comments | « tool/input_sdk/private/isolate_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698