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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart

Issue 18461006: Account for boolean operators shortcircuiting behavior (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Sync to head Created 7 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
index 7b016b85d57f510f171ed95b08037acc26322129..b519c8d9a9e6e0e59d86e7de555d7229306fcb52 100644
--- a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
@@ -2288,8 +2288,8 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
: environment.lookupTypeOfThis();
SourceString name =
canonicalizeMethodName(node.selector.asIdentifier().source);
- ArgumentsTypes argumentsTypes = analyzeArguments(node.arguments);
if (name.stringValue == '!=') {
+ ArgumentsTypes argumentsTypes = analyzeArguments(node.arguments);
ConcreteType returnType = analyzeDynamicSend(elements.getSelector(node),
receiverType,
const SourceString('=='),
@@ -2298,8 +2298,12 @@ class TypeInferrerVisitor extends ResolvedVisitor<ConcreteType> {
? returnType
: inferrer.singletonConcreteType(inferrer.baseTypes.boolBaseType);
} else if (name.stringValue == '&&' || name.stringValue == '||'){
+ ConcreteTypesEnvironment oldEnvironment = environment;
+ analyze(node.arguments.head);
+ environment = oldEnvironment.join(environment);
return inferrer.singletonConcreteType(inferrer.baseTypes.boolBaseType);
} else {
+ ArgumentsTypes argumentsTypes = analyzeArguments(node.arguments);
return analyzeDynamicSend(elements.getSelector(node),
receiverType, name, argumentsTypes);
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/cpa_inference_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698