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

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

Issue 10544026: Simplify generated code for string interpolation by delaying the constant folding. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 6 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 | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/js_helper.dart
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
index dd043571b18514de01a99238aab430ea09c04417..55f0bbabd8a21b56b65c26a32c6b70e68f74b8cd 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -376,17 +376,12 @@ checkGrowable(list, reason) {
}
}
-String stringToString(value) {
+String S(value) {
var res = value.toString();
if (res is !String) throw new IllegalArgumentException(value);
return res;
}
-String stringConcat(String receiver, String other) {
- return JS('String', @'# + #', receiver, other);
-}
-
-
class ListIterator<T> implements Iterator<T> {
int i;
List<T> list;
@@ -415,13 +410,10 @@ class Primitives {
static final int DOLLAR_CHAR_VALUE = 36;
static String objectToString(Object object) {
- String name = JS('String', @'#.constructor.name', object);
- if (name === null) {
- name = JS('String', @'#.match(/^\s*function\s*\$?(\S*)\s*\(/)[1]',
- JS('String', @'#.constructor.toString()', object));
- } else {
- if (name.charCodeAt(0) === DOLLAR_CHAR_VALUE) name = name.substring(1);
- }
+ String name = getTypeNameOf(object);
sra1 2012/06/06 18:07:06 I think you should use getTypeNameOf only if the o
+ // TODO(kasperl): If the namer gave us a fresh global name, we may
+ // want to remove the numeric suffix that makes it unique too.
+ if (name.charCodeAt(0) === DOLLAR_CHAR_VALUE) name = name.substring(1);
return "Instance of '$name'";
}
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698