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

Unified Diff: lib/compiler/implementation/tree/nodes.dart

Issue 10696192: Transform (x && y) && z into x && (y && z). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 8 years, 5 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
Index: lib/compiler/implementation/tree/nodes.dart
diff --git a/lib/compiler/implementation/tree/nodes.dart b/lib/compiler/implementation/tree/nodes.dart
index 52c99bb6e2befd109526249dba6f539859680584..1e356539a9434db3c0ed19a13c0affec3fb8bd34 100644
--- a/lib/compiler/implementation/tree/nodes.dart
+++ b/lib/compiler/implementation/tree/nodes.dart
@@ -282,9 +282,13 @@ class Send extends Expression {
bool get isFunctionObjectInvocation() => selector === null;
bool get isPrefix() => argumentsNode is Prefix;
bool get isPostfix() => argumentsNode is Postfix;
+ bool get isCall() => !isOperator && !isPropertyAccess;
bool get isIndex() =>
isOperator && selector.asOperator().source.stringValue === '[]';
- bool get isCall() => !isOperator && !isPropertyAccess;
+ bool get isLogicalAnd() =>
+ isOperator && selector.asOperator().source.stringValue === '&&';
+ bool get isLogicalOr() =>
+ isOperator && selector.asOperator().source.stringValue === '||';
Token getBeginToken() {
if (isPrefix && !isIndex) return selector.getBeginToken();
« no previous file with comments | « lib/compiler/implementation/ssa/codegen_helpers.dart ('k') | tests/compiler/dart2js/ssa_phi_codegen_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698