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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart

Issue 2703263002: Custom formatter cleanup Fix case where displaying a class constructor generated unreadable huge ou… (Closed)
Patch Set: Custom formatter cleanup Fix case where displaying a class constructor generated unreadable huge ou… Created 3 years, 10 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
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
index 6f4236c65a8f00db2fbe669bfa4c72b835f1a026..9cb25382d2a34951a691863874e47e166e7b533d 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -882,6 +882,12 @@ String _toString(obj) {
return JS('String', '#[dartx.toString]()', obj);
}
if (JS('bool', 'typeof # == "function"', obj)) {
+ // If the function is a Type object, we should just display the type name.
+ // Regular Dart code should typically get wrapped type objects instead of
+ // raw type (aka JS constructor) objects however raw type objects can be
+ // exposed to Dart code via JS interop or debugging tools.
+ if (isType(obj)) return typeName(obj);
+
return JS(
'String', r'"Closure: " + # + " from: " + #', getReifiedType(obj), obj);
}
« no previous file with comments | « pkg/dev_compiler/test/codegen_expected/varargs.js ('k') | pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698