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

Unified Diff: dart/frog/leg/tree/nodes.dart

Issue 9447100: Return null from stringValue and call slowToString() instead of toString(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: changes Created 8 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
« no previous file with comments | « dart/frog/leg/ssa/tracer.dart ('k') | dart/frog/leg/typechecker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/tree/nodes.dart
diff --git a/dart/frog/leg/tree/nodes.dart b/dart/frog/leg/tree/nodes.dart
index c96e1fb06e3ecd41f0124bbf4a2ad0f7cac3f745..ce66d3fab17b8d1e7be6ec0ca2295afc4afdc39a 100644
--- a/dart/frog/leg/tree/nodes.dart
+++ b/dart/frog/leg/tree/nodes.dart
@@ -582,7 +582,7 @@ class LiteralInt extends Literal<int> {
try {
Token token = this.token;
if (token.kind === PLUS_TOKEN) token = token.next;
- return Math.parseInt(token.value.toString());
+ return Math.parseInt(token.value.slowToString());
} catch (BadNumberFormatException ex) {
(this.handler)(token, ex);
}
@@ -601,7 +601,7 @@ class LiteralDouble extends Literal<double> {
try {
Token token = this.token;
if (token.kind === PLUS_TOKEN) token = token.next;
- return Math.parseDouble(token.value.toString());
+ return Math.parseDouble(token.value.slowToString());
} catch (BadNumberFormatException ex) {
(this.handler)(token, ex);
}
@@ -748,7 +748,7 @@ class RawSourceDartString extends SourceBasedDartString {
Iterator<int> iterator() => source.iterator();
String toString() {
if (toStringCache !== null) return toStringCache;
- toStringCache = source.stringValue;
+ toStringCache = source.slowToString();
return toStringCache;
}
}
@@ -932,9 +932,9 @@ class Identifier extends Expression {
Identifier(Token this.token);
Identifier.synthetic(String name) : token = new StringToken(null, name, null);
- bool isThis() => source.stringValue == 'this';
+ bool isThis() => source.stringValue === 'this';
- bool isSuper() => source.stringValue == 'super';
+ bool isSuper() => source.stringValue === 'super';
Identifier asIdentifier() => this;
« no previous file with comments | « dart/frog/leg/ssa/tracer.dart ('k') | dart/frog/leg/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698