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

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

Issue 2735983003: Type of InstanceMirror on class should still be a ClassMirror when class has call method (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | sdk/lib/_internal/js_runtime/lib/js_mirrors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_helper.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 6e1548d396a3bb7cc40f13fa0de52e07bad54cc7..cb48d2df51071853dc49aa339b17acb9debeec49 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -2456,9 +2456,11 @@ convertDartClosureToJS(closure, int arity) {
return function;
}
-/**
- * Super class for Dart closures.
- */
+/// Superclass for Dart closures.
+///
+/// All static, tear-off, function declaration and function expression closures
+/// extend this class, but classes that implement Function via a `call` method
+/// do not.
abstract class Closure implements Function {
// TODO(ahe): These constants must be in sync with
// reflection_data_parser.dart.
@@ -2891,6 +2893,8 @@ abstract class Closure implements Function {
String toString() {
String name = Primitives.objectTypeName(this);
+ // Mirrors puts a space in front of some names, so remove it.
+ name = JS('String', '#.trim()', name);
return "Closure '$name'";
}
}
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698