FlowScope leftScope = firstPreciserScopeKnowingConditionOutcome(left, blindScope, !outcome); StaticTypedSlot leftVar = refinements.size() == 1 ? leftScope.getSlot(refinements.iterator().next()) : null; firstPreciserScopeKnowingConditionOutcome(left, blindScope, outcome), refinements); rightScope = firstPreciserScopeKnowingConditionOutcome(right, rightScope, !outcome); StaticTypedSlot rightVar = refinements.size() == 1 ? rightScope.getSlot(refinements.iterator().next()) : null;
leftIsRefineable = false; leftType = left.getJSType(); blindScope = firstPreciserScopeKnowingConditionOutcome( left, blindScope, outcome); leftType.getRestrictedTypeGivenToBooleanOutcome(outcome); if (restrictedLeftType == null) { return firstPreciserScopeKnowingConditionOutcome( right, blindScope, outcome); rightIsRefineable = false; rightType = right.getJSType(); blindScope = firstPreciserScopeKnowingConditionOutcome( right, blindScope, outcome);
leftIsRefineable = false; leftType = left.getJSType(); blindScope = firstPreciserScopeKnowingConditionOutcome( left, blindScope, outcome); leftType.getRestrictedTypeGivenToBooleanOutcome(outcome); if (restrictedLeftType == null) { return firstPreciserScopeKnowingConditionOutcome( right, blindScope, outcome); rightIsRefineable = false; rightType = right.getJSType(); blindScope = firstPreciserScopeKnowingConditionOutcome( right, blindScope, outcome);
private FlowScope caseAndOrMaybeShortCircuiting(Node left, Node right, FlowScope blindScope, boolean outcome) { FlowScope leftScope = firstPreciserScopeKnowingConditionOutcome( left, blindScope, !outcome); StaticTypedSlot<JSType> leftVar = leftScope.findUniqueRefinedSlot(blindScope); if (leftVar == null) { // If we did create a more precise scope, blindScope has a child and // it is frozen. We can't just throw it away to return it. So we // must create a child instead. return blindScope == leftScope ? blindScope : blindScope.createChildFlowScope(); } FlowScope rightScope = firstPreciserScopeKnowingConditionOutcome( left, blindScope, outcome); rightScope = firstPreciserScopeKnowingConditionOutcome( right, rightScope, !outcome); StaticTypedSlot<JSType> rightVar = rightScope.findUniqueRefinedSlot(blindScope); if (rightVar == null || !leftVar.getName().equals(rightVar.getName())) { return blindScope == rightScope ? blindScope : blindScope.createChildFlowScope(); } JSType type = leftVar.getType().getLeastSupertype(rightVar.getType()); FlowScope informed = blindScope.createChildFlowScope(); informed.inferSlotType(leftVar.getName(), type); return informed; }
return firstPreciserScopeKnowingConditionOutcome( condition.getFirstChild(), firstPreciserScopeKnowingConditionOutcome( condition.getSecondChild(), blindScope, outcome), outcome); return firstPreciserScopeKnowingConditionOutcome( condition.getFirstChild(), blindScope, !outcome);
return firstPreciserScopeKnowingConditionOutcome( condition.getFirstChild(), firstPreciserScopeKnowingConditionOutcome( condition.getSecondChild(), blindScope, outcome), outcome); return firstPreciserScopeKnowingConditionOutcome( condition.getFirstChild(), blindScope, !outcome);