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

Unified Diff: samples/third_party/dromaeo/common/JSON.dart

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 1 month 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 | « samples/third_party/dromaeo/Suites.dart ('k') | samples/third_party/dromaeo/tests/dom-traverse-html.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/third_party/dromaeo/common/JSON.dart
diff --git a/samples/third_party/dromaeo/common/JSON.dart b/samples/third_party/dromaeo/common/JSON.dart
index f3d0624abce7f7ba88d43a6b10b2ccf3a669274e..483f2a3cd1a8b8c7324d5fd8cd456b5d24f59389 100644
--- a/samples/third_party/dromaeo/common/JSON.dart
+++ b/samples/third_party/dromaeo/common/JSON.dart
@@ -344,14 +344,14 @@ class JsonParser {
JsonToken token = _tokenizer.next();
final result = _parseValue(token);
token = _tokenizer.next();
- if (token !== null) {
+ if (token != null) {
throw 'Junk at the end';
}
return result;
}
_parseValue(final JsonToken token) {
- if (token === null) {
+ if (token == null) {
throw 'Nothing to parse';
}
switch (token.kind) {
@@ -414,7 +414,7 @@ class JsonParser {
void _parseSequence(int endTokenKind, void parseElement(JsonToken token)) {
JsonToken token = _tokenizer.next();
- if (token === null) {
+ if (token == null) {
throw 'Unexpected end of stream';
}
if (token.kind == endTokenKind) {
@@ -424,7 +424,7 @@ class JsonParser {
parseElement(token);
token = _tokenizer.next();
- if (token === null) {
+ if (token == null) {
throw 'Expected either comma or terminator';
}
while (token.kind != endTokenKind) {
@@ -438,7 +438,7 @@ class JsonParser {
}
void _assertTokenKind(JsonToken token, int kind) {
- if (token === null || token.kind != kind) {
+ if (token == null || token.kind != kind) {
throw 'Unexpected token kind: token = ${token}, expected kind = ${kind}';
}
}
@@ -506,7 +506,7 @@ class JsonStringifier {
void _checkCycle(final object) {
// TODO: use Iterables.
for (int i = 0; i < _seen.length; i++) {
- if (_seen[i] === object) {
+ if (identical(_seen[i], object)) {
throw 'Cyclic structure';
}
}
@@ -518,13 +518,13 @@ class JsonStringifier {
// TODO: use writeOn.
_sb.add(_numberToString(object));
return;
- } else if (object === true) {
+ } else if (identical(object, true)) {
_sb.add('true');
return;
- } else if (object === false) {
+ } else if (identical(object, false)) {
_sb.add('false');
return;
- } else if (object === null) {
+ } else if (object == null) {
_sb.add('null');
return;
} else if (object is String) {
« no previous file with comments | « samples/third_party/dromaeo/Suites.dart ('k') | samples/third_party/dromaeo/tests/dom-traverse-html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698