Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–864 unchanged (864 lines)
865 call = (ArrowType) safeResolve(call, t, scope);
866 prototype = (FunctionPrototypeType) safeResolve(prototype, t, scope);
867
868 // Warning about typeOfThis if it doesn't resolve to an ObjectType
869 // is handled further upstream.
870 // TODO(nicksantos): Handle this correctly if we have a UnionType.
871 typeOfThis = (ObjectType) safeResolve(typeOfThis, t, scope);
872
873 boolean changed = false;
874 ImmutableList.Builder<ObjectType> resolvedInterfaces =
875 ImmutableList.builder();
876 for (ObjectType iface : implementedInterfaces) {
877 ObjectType resolvedIface = (ObjectType) iface.resolve(t, scope);
…lines 878–935 unchanged (58 lines)

After

…lines 1–864 unchanged (864 lines)
865 call = (ArrowType) safeResolve(call, t, scope);
866 prototype = (FunctionPrototypeType) safeResolve(prototype, t, scope);
867
868 // Warning about typeOfThis if it doesn't resolve to an ObjectType
869 // is handled further upstream.
870 // TODO(nicksantos): Handle this correctly if we have a UnionType.
871 JSType maybeTypeOfThis = safeResolve(typeOfThis, t, scope);
872 if (maybeTypeOfThis instanceof ObjectType) {
873 typeOfThis = (ObjectType) maybeTypeOfThis;
874 }
875
876 boolean changed = false;
877 ImmutableList.Builder<ObjectType> resolvedInterfaces =
878 ImmutableList.builder();
879 for (ObjectType iface : implementedInterfaces) {
880 ObjectType resolvedIface = (ObjectType) iface.resolve(t, scope);
…lines 881–938 unchanged (58 lines)

Before

program
block_comment "/*\n *\n * ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
; ";"
import_declaration (+23 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Iterables"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Sets"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "ErrorReporter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * This derived type provides extended information about"...
class_declaration
modifiers
public "public"
class "class"
identifier "FunctionType"
superclass
extends "extends"
type_identifier "PrototypeObjectType"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
enum_declaration
modifiers
private "private"
enum "enum"
identifier "Kind"
enum_body
{ "{"
enum_constant
identifier "ORDINARY"
, ","
enum_constant
identifier "CONSTRUCTOR"
, ","
enum_constant
identifier "INTERFACE"
} "}"
block_comment "/**\n * {@code [[Call]]} property.\n */"
field_declaration
modifiers
private "private"
type_identifier "ArrowType"
variable_declarator
identifier "call"
; ";"
block_comment "/**\n * The {@code prototype} property. This field is lazil"...
field_declaration
modifiers
private "private"
type_identifier "FunctionPrototypeType"
variable_declarator
identifier "prototype"
; ";"
block_comment "/**\n * Whether a function is a constructor, an interface, "...
field_declaration
modifiers
private "private"
final "final"
type_identifier "Kind"
variable_declarator
identifier "kind"
; ";"
block_comment "/**\n * The type of {@code this} in the scope of this funct"...
field_declaration
modifiers
private "private"
type_identifier "ObjectType"
variable_declarator
identifier "typeOfThis"
; ";"
block_comment "/**\n * The function node which this type represents. It ma"...
field_declaration
modifiers
private "private"
type_identifier "Node"
variable_declarator
identifier "source"
; ";"
block_comment "/**\n * The interfaces directly implemented by this functio"...
field_declaration
modifiers
private "private"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "ObjectType"
> ">"
variable_declarator
identifier "implementedInterfaces"
= "="
method_invocation
identifier "ImmutableList"
. "."
identifier "of"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * The types which are subtypes of this function. It i"...
field_declaration
modifiers
private "private"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "FunctionType"
> ">"
variable_declarator
identifier "subTypes"
; ";"
block_comment "/**\n * The template type name. May be {@code null}.\n */"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "templateTypeName"
; ";"
block_comment "/** Creates an instance for a function that might be a const"...
constructor_declaration (+223 nodes collapsed)
block_comment "/** Creates an instance for a function that is an interface."...
constructor_declaration (+149 nodes collapsed)
block_comment "/** Creates an instance for a function that is an interface."...
method_declaration (+36 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
boolean_type "boolean"
identifier "isFunctionType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
true "true"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
boolean_type "boolean"
identifier "canBeCalled"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
true "true"
; ";"
} "}"
method_declaration (+63 nodes collapsed)
block_comment "/** Gets an LP node that contains all params. May be null. *"...
method_declaration
modifiers
public "public"
type_identifier "Node"
identifier "getParametersNode"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "call"
. "."
identifier "parameters"
; ";"
} "}"
block_comment "/** Gets the minimum number of arguments that this function "...
method_declaration (+89 nodes collapsed)
block_comment "/**\n * Gets the maximum number of arguments that this func"...
method_declaration (+88 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "JSType"
identifier "getReturnType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "call"
. "."
identifier "returnType"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isReturnTypeInferred"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "call"
. "."
identifier "returnTypeInferred"
; ";"
} "}"
block_comment "/** Gets the internal arrow type. For use by subclasses only"...
method_declaration
type_identifier "ArrowType"
identifier "getInternalArrowType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "call"
; ";"
} "}"
block_comment "/**\n * Gets the {@code prototype} property of this functio"...
method_declaration (+46 nodes collapsed)
block_comment "/**\n * Sets the prototype, creating the prototype object f"...
method_declaration (+64 nodes collapsed)
block_comment "/**\n * Sets the prototype.\n * @param prototype the proto"...
method_declaration (+124 nodes collapsed)
block_comment "/**\n * Returns all interfaces implemented by a class or it"...
method_declaration (+65 nodes collapsed)
method_declaration (+118 nodes collapsed)
block_comment "/** Returns interfaces implemented directly by a class or it"...
method_declaration (+75 nodes collapsed)
method_declaration (+59 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+396 nodes collapsed)
method_declaration (+142 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Computes the supremum or infimum of functions with "...
method_declaration (+410 nodes collapsed)
block_comment "/**\n * Try to get the sup/inf of two functions by looking "...
method_declaration (+287 nodes collapsed)
block_comment "/**\n * Given a constructor or an interface type, get its s"...
method_declaration (+75 nodes collapsed)
block_comment "/**\n * Given a constructor or an interface type, find out "...
method_declaration (+175 nodes collapsed)
block_comment "/**\n * Given a constructor or an interface type and a prop"...
method_declaration (+126 nodes collapsed)
block_comment "/**\n * Two function types are equal if their signatures ma"...
method_declaration (+220 nodes collapsed)
method_declaration (+44 nodes collapsed)
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Informally, a function is represented by\n * {@cod"...
method_declaration (+388 nodes collapsed)
block_comment "/** Gets the string representation of a var args param. */"
method_declaration (+100 nodes collapsed)
block_comment "/**\n * A function is a subtype of another if their call me"...
method_declaration (+208 nodes collapsed)
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Gets the type of instance of this function.\n * @t"...
method_declaration (+29 nodes collapsed)
block_comment "/** Sets the instance type. This should only be used for spe"...
method_declaration
void_type "void"
identifier "setInstanceType"
formal_parameters
( "("
formal_parameter
type_identifier "ObjectType"
identifier "instanceType"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "typeOfThis"
= "="
identifier "instanceType"
; ";"
} "}"
block_comment "/**\n * Returns whether this function type has an instance "...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Gets the type of {@code this} in this function.\n "...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Gets the source node or null if this is an unknown "...
method_declaration
modifiers
public "public"
type_identifier "Node"
identifier "getSource"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "source"
; ";"
} "}"
block_comment "/**\n * Sets the source node.\n */"
method_declaration (+23 nodes collapsed)
block_comment "/** Adds a type to the list of subtypes for this type. */"
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Returns a list of types that are subtypes of this t"...
method_declaration
modifiers
public "public"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "FunctionType"
> ">"
identifier "getSubTypes"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "subTypes"
; ";"
} "}"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Gets the template type name.\n */"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getTemplateTypeName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "templateTypeName"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
type_identifier "JSType"
identifier "resolveInternal"
formal_parameters
( "("
formal_parameter
type_identifier "ErrorReporter"
identifier "t"
, ","
formal_parameter
generic_type
type_identifier "StaticScope"
type_arguments
< "<"
type_identifier "JSType"
> ">"
identifier "scope"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "setResolvedTypeInternal"
argument_list
( "("
this "this"
) ")"
; ";"
expression_statement
assignment_expression
identifier "call"
= "="
cast_expression
( "("
type_identifier "ArrowType"
) ")"
method_invocation
identifier "safeResolve"
argument_list
( "("
identifier "call"
, ","
identifier "t"
, ","
identifier "scope"
) ")"
; ";"
expression_statement
assignment_expression
identifier "prototype"
= "="
cast_expression
( "("
type_identifier "FunctionPrototypeType"
) ")"
method_invocation
identifier "safeResolve"
argument_list
( "("
identifier "prototype"
, ","
identifier "t"
, ","
identifier "scope"
) ")"
; ";"
line_comment "// Warning about typeOfThis if it doesn't resolve to an Obje"...
line_comment "// is handled further upstream."
line_comment "// TODO(nicksantos): Handle this correctly if we have a Unio"...
expression_statement
assignment_expression
identifier "typeOfThis"
= "="
cast_expression
( "("
type_identifier "ObjectType"
) ")"
method_invocation
identifier "safeResolve"
argument_list
( "("
identifier "typeOfThis"
, ","
identifier "t"
, ","
identifier "scope"
) ")"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "changed"
= "="
false "false"
; ";"
local_variable_declaration (+21 nodes collapsed)
enhanced_for_statement (+53 nodes collapsed)
if_statement (+21 nodes collapsed)
if_statement (+73 nodes collapsed)
return_statement
return "return"
method_invocation
super "super"
. "."
identifier "resolveInternal"
argument_list
( "("
identifier "t"
, ","
identifier "scope"
) ")"
; ";"
} "}"
method_declaration (+336 nodes collapsed)
method_declaration (+47 nodes collapsed)
} "}"

After

program
block_comment "/*\n *\n * ***** BEGIN LICENSE BLOCK *****\n * Version: MPL 1.1"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
; ";"
import_declaration (+23 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableList"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Iterables"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Sets"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "ErrorReporter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Collections"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * This derived type provides extended information about"...
class_declaration
modifiers
public "public"
class "class"
identifier "FunctionType"
superclass
extends "extends"
type_identifier "PrototypeObjectType"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
enum_declaration
modifiers
private "private"
enum "enum"
identifier "Kind"
enum_body
{ "{"
enum_constant
identifier "ORDINARY"
, ","
enum_constant
identifier "CONSTRUCTOR"
, ","
enum_constant
identifier "INTERFACE"
} "}"
block_comment "/**\n * {@code [[Call]]} property.\n */"
field_declaration
modifiers
private "private"
type_identifier "ArrowType"
variable_declarator
identifier "call"
; ";"
block_comment "/**\n * The {@code prototype} property. This field is lazil"...
field_declaration
modifiers
private "private"
type_identifier "FunctionPrototypeType"
variable_declarator
identifier "prototype"
; ";"
block_comment "/**\n * Whether a function is a constructor, an interface, "...
field_declaration
modifiers
private "private"
final "final"
type_identifier "Kind"
variable_declarator
identifier "kind"
; ";"
block_comment "/**\n * The type of {@code this} in the scope of this funct"...
field_declaration
modifiers
private "private"
type_identifier "ObjectType"
variable_declarator
identifier "typeOfThis"
; ";"
block_comment "/**\n * The function node which this type represents. It ma"...
field_declaration
modifiers
private "private"
type_identifier "Node"
variable_declarator
identifier "source"
; ";"
block_comment "/**\n * The interfaces directly implemented by this functio"...
field_declaration
modifiers
private "private"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "ObjectType"
> ">"
variable_declarator
identifier "implementedInterfaces"
= "="
method_invocation
identifier "ImmutableList"
. "."
identifier "of"
argument_list
( "("
) ")"
; ";"
block_comment "/**\n * The types which are subtypes of this function. It i"...
field_declaration
modifiers
private "private"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "FunctionType"
> ">"
variable_declarator
identifier "subTypes"
; ";"
block_comment "/**\n * The template type name. May be {@code null}.\n */"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "templateTypeName"
; ";"
block_comment "/** Creates an instance for a function that might be a const"...
constructor_declaration (+223 nodes collapsed)
block_comment "/** Creates an instance for a function that is an interface."...
constructor_declaration (+149 nodes collapsed)
block_comment "/** Creates an instance for a function that is an interface."...
method_declaration (+36 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration (+24 nodes collapsed)
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
boolean_type "boolean"
identifier "isFunctionType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
true "true"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
boolean_type "boolean"
identifier "canBeCalled"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
true "true"
; ";"
} "}"
method_declaration (+63 nodes collapsed)
block_comment "/** Gets an LP node that contains all params. May be null. *"...
method_declaration
modifiers
public "public"
type_identifier "Node"
identifier "getParametersNode"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "call"
. "."
identifier "parameters"
; ";"
} "}"
block_comment "/** Gets the minimum number of arguments that this function "...
method_declaration (+89 nodes collapsed)
block_comment "/**\n * Gets the maximum number of arguments that this func"...
method_declaration (+88 nodes collapsed)
method_declaration
modifiers
public "public"
type_identifier "JSType"
identifier "getReturnType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "call"
. "."
identifier "returnType"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isReturnTypeInferred"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
field_access
identifier "call"
. "."
identifier "returnTypeInferred"
; ";"
} "}"
block_comment "/** Gets the internal arrow type. For use by subclasses only"...
method_declaration
type_identifier "ArrowType"
identifier "getInternalArrowType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "call"
; ";"
} "}"
block_comment "/**\n * Gets the {@code prototype} property of this functio"...
method_declaration (+46 nodes collapsed)
block_comment "/**\n * Sets the prototype, creating the prototype object f"...
method_declaration (+64 nodes collapsed)
block_comment "/**\n * Sets the prototype.\n * @param prototype the proto"...
method_declaration (+124 nodes collapsed)
block_comment "/**\n * Returns all interfaces implemented by a class or it"...
method_declaration (+65 nodes collapsed)
method_declaration (+118 nodes collapsed)
block_comment "/** Returns interfaces implemented directly by a class or it"...
method_declaration (+75 nodes collapsed)
method_declaration (+59 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+396 nodes collapsed)
method_declaration (+142 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+28 nodes collapsed)
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Computes the supremum or infimum of functions with "...
method_declaration (+410 nodes collapsed)
block_comment "/**\n * Try to get the sup/inf of two functions by looking "...
method_declaration (+287 nodes collapsed)
block_comment "/**\n * Given a constructor or an interface type, get its s"...
method_declaration (+75 nodes collapsed)
block_comment "/**\n * Given a constructor or an interface type, find out "...
method_declaration (+175 nodes collapsed)
block_comment "/**\n * Given a constructor or an interface type and a prop"...
method_declaration (+126 nodes collapsed)
block_comment "/**\n * Two function types are equal if their signatures ma"...
method_declaration (+220 nodes collapsed)
method_declaration (+44 nodes collapsed)
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Informally, a function is represented by\n * {@cod"...
method_declaration (+388 nodes collapsed)
block_comment "/** Gets the string representation of a var args param. */"
method_declaration (+100 nodes collapsed)
block_comment "/**\n * A function is a subtype of another if their call me"...
method_declaration (+208 nodes collapsed)
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Gets the type of instance of this function.\n * @t"...
method_declaration (+29 nodes collapsed)
block_comment "/** Sets the instance type. This should only be used for spe"...
method_declaration
void_type "void"
identifier "setInstanceType"
formal_parameters
( "("
formal_parameter
type_identifier "ObjectType"
identifier "instanceType"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "typeOfThis"
= "="
identifier "instanceType"
; ";"
} "}"
block_comment "/**\n * Returns whether this function type has an instance "...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Gets the type of {@code this} in this function.\n "...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Gets the source node or null if this is an unknown "...
method_declaration
modifiers
public "public"
type_identifier "Node"
identifier "getSource"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "source"
; ";"
} "}"
block_comment "/**\n * Sets the source node.\n */"
method_declaration (+23 nodes collapsed)
block_comment "/** Adds a type to the list of subtypes for this type. */"
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Returns a list of types that are subtypes of this t"...
method_declaration
modifiers
public "public"
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "FunctionType"
> ">"
identifier "getSubTypes"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "subTypes"
; ";"
} "}"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Gets the template type name.\n */"
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getTemplateTypeName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "templateTypeName"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
type_identifier "JSType"
identifier "resolveInternal"
formal_parameters
( "("
formal_parameter
type_identifier "ErrorReporter"
identifier "t"
, ","
formal_parameter
generic_type
type_identifier "StaticScope"
type_arguments
< "<"
type_identifier "JSType"
> ">"
identifier "scope"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "setResolvedTypeInternal"
argument_list
( "("
this "this"
) ")"
; ";"
expression_statement
assignment_expression
identifier "call"
= "="
cast_expression
( "("
type_identifier "ArrowType"
) ")"
method_invocation
identifier "safeResolve"
argument_list
( "("
identifier "call"
, ","
identifier "t"
, ","
identifier "scope"
) ")"
; ";"
expression_statement
assignment_expression
identifier "prototype"
= "="
cast_expression
( "("
type_identifier "FunctionPrototypeType"
) ")"
method_invocation
identifier "safeResolve"
argument_list
( "("
identifier "prototype"
, ","
identifier "t"
, ","
identifier "scope"
) ")"
; ";"
line_comment "// Warning about typeOfThis if it doesn't resolve to an Obje"...
line_comment "// is handled further upstream."
line_comment "// TODO(nicksantos): Handle this correctly if we have a Unio"...
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "maybeTypeOfThis"
= "="
method_invocation
identifier "safeResolve"
argument_list
( "("
identifier "typeOfThis"
, ","
identifier "t"
, ","
identifier "scope"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
instanceof_expression
identifier "maybeTypeOfThis"
instanceof "instanceof"
type_identifier "ObjectType"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "typeOfThis"
= "="
cast_expression
( "("
type_identifier "ObjectType"
) ")"
identifier "maybeTypeOfThis"
; ";"
} "}"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "changed"
= "="
false "false"
; ";"
local_variable_declaration (+21 nodes collapsed)
enhanced_for_statement (+53 nodes collapsed)
if_statement (+21 nodes collapsed)
if_statement (+73 nodes collapsed)
return_statement
return "return"
method_invocation
super "super"
. "."
identifier "resolveInternal"
argument_list
( "("
identifier "t"
, ","
identifier "scope"
) ")"
; ";"
} "}"
method_declaration (+336 nodes collapsed)
method_declaration (+47 nodes collapsed)
} "}"