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

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

Issue 1993293002: fix #577 - correctly toString ES Symbols (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 | « test/browser/runtime_tests.js ('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/ddc_runtime/operations.dart
diff --git a/tool/input_sdk/private/ddc_runtime/operations.dart b/tool/input_sdk/private/ddc_runtime/operations.dart
index b9a324d7792a0b58e0599dda5fb1730680ddb3cc..3d7ea835c0a9cb9cd92e39e4faf023c6b642e8e6 100644
--- a/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -459,14 +459,18 @@ hashCode(obj) {
}
@JSExportName('toString')
-_toString(obj) {
+String _toString(obj) {
if (obj == null) return "null";
var extension = getExtensionType(obj);
if (extension != null) {
- return JS('', '#[dartx.toString]()', obj);
+ return JS('String', '#[dartx.toString]()', obj);
}
- return JS('', '"" + #', obj);
+ // TODO(jmesserly): restore this faster path once ES Symbol is treated as
+ // an extension type (and thus hits the above code path).
+ // See https://github.com/dart-lang/dev_compiler/issues/578.
+ // return JS('', '"" + #', obj);
+ return JS('String', '#.toString()', obj);
}
// TODO(jmesserly): is the argument type verified statically?
« no previous file with comments | « test/browser/runtime_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698