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

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

Issue 11233035: Use == instead of identical for integers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typos. Created 8 years, 2 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: lib/compiler/implementation/string_validator.dart
diff --git a/lib/compiler/implementation/string_validator.dart b/lib/compiler/implementation/string_validator.dart
index 2951f568f32714caa873d66d6bdad8897d202920..2deed37691a843b7ce39531ee69bb2b9f6acb799 100644
--- a/lib/compiler/implementation/string_validator.dart
+++ b/lib/compiler/implementation/string_validator.dart
@@ -53,24 +53,24 @@ class StringValidator {
raw = true;
quoteChar = source.next();
}
- assert(identical(quoteChar, $SQ) || identical(quoteChar, $DQ));
+ assert(quoteChar == $SQ || quoteChar == $DQ);
// String has at least one quote. Check it if has three.
// If it only have two, the string must be an empty string literal,
// and end after the second quote.
bool multiline = false;
- if (source.hasNext() && identical(source.next(), quoteChar) && source.hasNext()) {
+ if (source.hasNext() && source.next() == quoteChar && source.hasNext()) {
int code = source.next();
- assert(identical(code, quoteChar)); // If not, there is a bug in the parser.
+ assert(code == quoteChar); // If not, there is a bug in the parser.
quoteLength = 3;
// Check if a multiline string starts with a newline (CR, LF or CR+LF).
if (source.hasNext()) {
code = source.next();
- if (identical(code, $CR)) {
+ if (code == $CR) {
quoteLength += 1;
- if (source.hasNext() && identical(source.next(), $LF)) {
+ if (source.hasNext() && source.next() == $LF) {
quoteLength += 1;
}
- } else if (identical(code, $LF)) {
+ } else if (code == $LF) {
quoteLength += 1;
}
}
@@ -99,7 +99,7 @@ class StringValidator {
for(Iterator<int> iter = string.iterator(); iter.hasNext(); length++) {
index++;
int code = iter.next();
- if (identical(code, $BACKSLASH)) {
+ if (code == $BACKSLASH) {
if (quoting.raw) continue;
containsEscape = true;
if (!iter.hasNext()) {
@@ -108,7 +108,7 @@ class StringValidator {
}
index++;
code = iter.next();
- if (identical(code, $x)) {
+ if (code == $x) {
for (int i = 0; i < 2; i++) {
if (!iter.hasNext()) {
stringParseError("Incomplete escape sequence", token, index);
@@ -124,7 +124,7 @@ class StringValidator {
}
// A two-byte hex escape can't generate an invalid value.
continue;
- } else if (identical(code, $u)) {
+ } else if (code == $u) {
int escapeStart = index - 1;
index++;
code = iter.next();
« 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