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

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

Issue 2642823010: Tweak runtimeTypeToString for better return type inference (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/js_rti.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
index 2ba517c334044a9ad4cbd6254e05a4821e0ebcf8..de7db233558002a16e2375aa284c7530a769bb20 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
@@ -169,11 +169,7 @@ String runtimeTypeToString(var rti, {String onTypeVariable(int i)}) {
return rawRtiToJsConstructorName(rti);
}
if (rti is int) {
- if (onTypeVariable == null) {
- return rti.toString();
- } else {
- return onTypeVariable(rti);
- }
+ return '${onTypeVariable == null ? rti : onTypeVariable(rti)}';
}
if (JS('bool', 'typeof #.func != "undefined"', rti)) {
// If the RTI has typedef equivalence info (via mirrors), use that since the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698