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

Unified Diff: pkg/analyzer/test/generated/ast_test.dart

Issue 221483002: Fix for translation of \!= to \!identical(), but use == and \!= for Enum. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/ast_test.dart
diff --git a/pkg/analyzer/test/generated/ast_test.dart b/pkg/analyzer/test/generated/ast_test.dart
index e215fdb03a8cbd16b9f5877cf31bc8ff455d813a..b582327836daa8dc9f3bea3e6ff23f2e8c0fbb2f 100644
--- a/pkg/analyzer/test/generated/ast_test.dart
+++ b/pkg/analyzer/test/generated/ast_test.dart
@@ -818,7 +818,7 @@ class SimpleIdentifierTest extends ParserTestCase {
for (WrapperKind wrapper in WrapperKind.values) {
for (AssignmentKind assignment in AssignmentKind.values) {
SimpleIdentifier identifier = _createIdentifier(wrapper, assignment);
- if (identical(assignment, AssignmentKind.SIMPLE_LEFT) && wrapper != WrapperKind.PREFIXED_LEFT && wrapper != WrapperKind.PROPERTY_LEFT) {
+ if (assignment == AssignmentKind.SIMPLE_LEFT && wrapper != WrapperKind.PREFIXED_LEFT && wrapper != WrapperKind.PROPERTY_LEFT) {
if (identifier.inGetterContext()) {
JUnitTestCase.fail("Expected ${_topMostNode(identifier).toSource()} to be false");
}
@@ -842,7 +842,7 @@ class SimpleIdentifierTest extends ParserTestCase {
for (WrapperKind wrapper in WrapperKind.values) {
for (AssignmentKind assignment in AssignmentKind.values) {
SimpleIdentifier identifier = _createIdentifier(wrapper, assignment);
- if (identical(wrapper, WrapperKind.PREFIXED_LEFT) || identical(wrapper, WrapperKind.PROPERTY_LEFT) || identical(assignment, AssignmentKind.BINARY) || identical(assignment, AssignmentKind.COMPOUND_RIGHT) || identical(assignment, AssignmentKind.PREFIX_NOT) || identical(assignment, AssignmentKind.SIMPLE_RIGHT) || identical(assignment, AssignmentKind.NONE)) {
+ if (wrapper == WrapperKind.PREFIXED_LEFT || wrapper == WrapperKind.PROPERTY_LEFT || assignment == AssignmentKind.BINARY || assignment == AssignmentKind.COMPOUND_RIGHT || assignment == AssignmentKind.PREFIX_NOT || assignment == AssignmentKind.SIMPLE_RIGHT || assignment == AssignmentKind.NONE) {
if (identifier.inSetterContext()) {
JUnitTestCase.fail("Expected ${_topMostNode(identifier).toSource()} to be false");
}
@@ -1000,27 +1000,27 @@ class SimpleIdentifierTest extends ParserTestCase {
}
class AssignmentKind extends Enum<AssignmentKind> {
- static final AssignmentKind BINARY = new AssignmentKind('BINARY', 0);
+ static const AssignmentKind BINARY = const AssignmentKind('BINARY', 0);
- static final AssignmentKind COMPOUND_LEFT = new AssignmentKind('COMPOUND_LEFT', 1);
+ static const AssignmentKind COMPOUND_LEFT = const AssignmentKind('COMPOUND_LEFT', 1);
- static final AssignmentKind COMPOUND_RIGHT = new AssignmentKind('COMPOUND_RIGHT', 2);
+ static const AssignmentKind COMPOUND_RIGHT = const AssignmentKind('COMPOUND_RIGHT', 2);
- static final AssignmentKind POSTFIX_INC = new AssignmentKind('POSTFIX_INC', 3);
+ static const AssignmentKind POSTFIX_INC = const AssignmentKind('POSTFIX_INC', 3);
- static final AssignmentKind PREFIX_DEC = new AssignmentKind('PREFIX_DEC', 4);
+ static const AssignmentKind PREFIX_DEC = const AssignmentKind('PREFIX_DEC', 4);
- static final AssignmentKind PREFIX_INC = new AssignmentKind('PREFIX_INC', 5);
+ static const AssignmentKind PREFIX_INC = const AssignmentKind('PREFIX_INC', 5);
- static final AssignmentKind PREFIX_NOT = new AssignmentKind('PREFIX_NOT', 6);
+ static const AssignmentKind PREFIX_NOT = const AssignmentKind('PREFIX_NOT', 6);
- static final AssignmentKind SIMPLE_LEFT = new AssignmentKind('SIMPLE_LEFT', 7);
+ static const AssignmentKind SIMPLE_LEFT = const AssignmentKind('SIMPLE_LEFT', 7);
- static final AssignmentKind SIMPLE_RIGHT = new AssignmentKind('SIMPLE_RIGHT', 8);
+ static const AssignmentKind SIMPLE_RIGHT = const AssignmentKind('SIMPLE_RIGHT', 8);
- static final AssignmentKind NONE = new AssignmentKind('NONE', 9);
+ static const AssignmentKind NONE = const AssignmentKind('NONE', 9);
- static final List<AssignmentKind> values = [
+ static const List<AssignmentKind> values = const [
BINARY,
COMPOUND_LEFT,
COMPOUND_RIGHT,
@@ -1032,28 +1032,28 @@ class AssignmentKind extends Enum<AssignmentKind> {
SIMPLE_RIGHT,
NONE];
- AssignmentKind(String name, int ordinal) : super(name, ordinal);
+ const AssignmentKind(String name, int ordinal) : super(name, ordinal);
}
class WrapperKind extends Enum<WrapperKind> {
- static final WrapperKind PREFIXED_LEFT = new WrapperKind('PREFIXED_LEFT', 0);
+ static const WrapperKind PREFIXED_LEFT = const WrapperKind('PREFIXED_LEFT', 0);
- static final WrapperKind PREFIXED_RIGHT = new WrapperKind('PREFIXED_RIGHT', 1);
+ static const WrapperKind PREFIXED_RIGHT = const WrapperKind('PREFIXED_RIGHT', 1);
- static final WrapperKind PROPERTY_LEFT = new WrapperKind('PROPERTY_LEFT', 2);
+ static const WrapperKind PROPERTY_LEFT = const WrapperKind('PROPERTY_LEFT', 2);
- static final WrapperKind PROPERTY_RIGHT = new WrapperKind('PROPERTY_RIGHT', 3);
+ static const WrapperKind PROPERTY_RIGHT = const WrapperKind('PROPERTY_RIGHT', 3);
- static final WrapperKind NONE = new WrapperKind('NONE', 4);
+ static const WrapperKind NONE = const WrapperKind('NONE', 4);
- static final List<WrapperKind> values = [
+ static const List<WrapperKind> values = const [
PREFIXED_LEFT,
PREFIXED_RIGHT,
PROPERTY_LEFT,
PROPERTY_RIGHT,
NONE];
- WrapperKind(String name, int ordinal) : super(name, ordinal);
+ const WrapperKind(String name, int ordinal) : super(name, ordinal);
}
class BreadthFirstVisitorTest extends ParserTestCase {
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698