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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart

Issue 11565034: Improve performance of dart2js StringBuffer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated to lib_v2 and private libraries. Created 7 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
Index: dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index 94fd88763ca0986236931924e7caab2dabe5da2b..1014f047542f1e7c1666ef7752768e05f228991f 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -37,6 +37,11 @@ checkGrowable(list, reason) {
}
String S(value) {
+ if (value is String) return value;
+ if ((value is num && value != 0) || value is bool) {
+ return JS('String', r'String(#)', value);
+ }
+ if (value == null) return 'null';
var res = value.toString();
if (res is !String) throw new ArgumentError(value);
return res;

Powered by Google App Engine
This is Rietveld 408576698