| Code with Finding: |
class TightenTypes.NativeCallFunctionCall {
public Collection<Assignment> getAssignments(ConcreteScope scope) {
ConcreteType thisType = (firstArgument != null)
? inferConcreteType(scope, firstArgument)
: getTopScope().getTypeOfThis();
ConcreteType recvType = inferConcreteType(scope, receiver);
if (recvType instanceof ConcreteInstanceType &&
((ConcreteInstanceType) recvType).isFunctionPrototype()) {
recvType = thisType.getPropertyType(propName);
}
List<ConcreteType> argTypes = Lists.newArrayList();
// Skip the first argument for call() as it is the 'this' object.
for (Node arg = firstArgument.getNext();
arg != null;
arg = arg.getNext()) {
argTypes.add(inferConcreteType(scope, arg));
}
return getFunctionCallAssignments(recvType, thisType, argTypes);
}
}
|