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–699 unchanged (699 lines)
700 return new TypePair(p.typeB, p.typeA);
701 }
702
703 // other types
704 switch (this.testForEquality(that)) {
705 case TRUE:
706 return new TypePair(null, null);
707
708 case FALSE:
709 case UNKNOWN:
710 return new TypePair(this, that);
711 }
712
…lines 713–941 unchanged (229 lines)

After

…lines 1–699 unchanged (699 lines)
700 return new TypePair(p.typeB, p.typeA);
701 }
702
703 // other types
704 switch (this.testForEquality(that)) {
705 case TRUE:
706 JSType noType = getNativeType(JSTypeNative.NO_TYPE);
707 return new TypePair(noType, noType);
708
709 case FALSE:
710 case UNKNOWN:
711 return new TypePair(this, that);
712 }
713
…lines 714–942 unchanged (229 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 "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 "JSDocInfo"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Comparator"
; ";"
block_comment "/**\n * Represents JavaScript value types.<p>\n *\n * Types are"...
class_declaration
modifiers
public "public"
abstract "abstract"
class "class"
identifier "JSType"
super_interfaces
implements "implements"
type_list
type_identifier "Serializable"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "resolved"
= "="
false "false"
; ";"
field_declaration
modifiers
private "private"
type_identifier "JSType"
variable_declarator
identifier "resolveResult"
= "="
null_literal "null"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "UNKNOWN_NAME"
= "="
string_literal
" "\""
string_fragment "Unknown class name"
" "\""
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "NOT_A_CLASS"
= "="
string_literal
" "\""
string_fragment "Not declared as a constructor"
" "\""
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "NOT_A_TYPE"
= "="
string_literal
" "\""
string_fragment "Not declared as a type name"
" "\""
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "EMPTY_TYPE_COMPONENT"
= "="
string_literal
" "\""
string_fragment "Named type with empty name component"
" "\""
; ";"
block_comment "/**\n * Total ordering on types based on their textual repr"...
field_declaration (+70 nodes collapsed)
line_comment "// A flag set on enum definition tree nodes"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "ENUMDECL"
= "="
decimal_integer_literal "1"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "NOT_ENUMDECL"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "registry"
; ";"
constructor_declaration
identifier "JSType"
formal_parameters
( "("
formal_parameter
type_identifier "JSTypeRegistry"
identifier "registry"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "registry"
= "="
identifier "registry"
; ";"
} "}"
block_comment "/**\n * Utility method for less verbose code.\n */"
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Gets the docInfo for this type. By default, documen"...
method_declaration
modifiers
public "public"
type_identifier "JSDocInfo"
identifier "getJSDocInfo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * If we see a type name without braces, it might be l"...
method_declaration
void_type "void"
identifier "forgiveUnknownNames"
formal_parameters
( "("
) ")"
block
{ "{"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNoType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNoObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration (+27 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNumberObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNumberValueType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/** Whether this is the prototype of a function. */"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isFunctionPrototypeType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isStringObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
boolean_type "boolean"
identifier "isTheObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isStringValueType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Tests whether the type is a string (value or Object"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Tests whether the type is a number (value or Object"...
method_declaration (+31 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isArrayType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isBooleanObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isBooleanValueType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isRegexpType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isDateType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNullType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isVoidType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isAllType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isUnknownType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isCheckedUnknownType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isUnionType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isFunctionType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isEnumElementType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isEnumType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
boolean_type "boolean"
identifier "isNamedType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isRecordType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isTemplateType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Tests whether this type is an {@code Object}, or an"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isObject"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is a {@link FunctionType} that is"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isConstructor"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is a nominal type (a named instan"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNominalType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is an Instance object of some con"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInstanceType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is a {@link FunctionType} that is"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInterface"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is a {@link FunctionType} that is"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isOrdinaryFunction"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Checks if two types are equivalent.\n */"
method_declaration (+48 nodes collapsed)
method_declaration (+50 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+26 nodes collapsed)
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
final "final"
boolean_type "boolean"
identifier "matchesInt32Context"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "matchesNumberContext"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
final "final"
boolean_type "boolean"
identifier "matchesUint32Context"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "matchesNumberContext"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "matchesNumberContext"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "matchesStringContext"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "matchesObjectContext"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Coerces this type to an Object type, then gets the "...
method_declaration (+59 nodes collapsed)
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "canBeCalled"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Tests whether values of {@code this} type can be sa"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Gets the type to which this type auto-boxes.\n *\n "...
method_declaration
modifiers
public "public"
type_identifier "JSType"
identifier "autoboxesTo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * Gets the type to which this type unboxes.\n *\n *"...
method_declaration
modifiers
public "public"
type_identifier "JSType"
identifier "unboxesTo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * Casts this to an ObjectType, or returns null if thi"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Dereference a type for property access.\n *\n * A"...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Tests whether {@code this} and {@code that} are mea"...
method_declaration (+33 nodes collapsed)
block_comment "/**\n * Compares {@code this} and {@code that}.\n * @retur"...
method_declaration (+180 nodes collapsed)
block_comment "/**\n * Tests whether {@code this} and {@code that} are mea"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Tests whether this type is nullable.\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Gets the least supertype of {@code this} and {@code"...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * A generic implementation meant to be used as a help"...
method_declaration (+71 nodes collapsed)
block_comment "/**\n * Gets the greatest subtype of {@code this} and {@cod"...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * A generic implementation meant to be used as a help"...
method_declaration (+271 nodes collapsed)
block_comment "/**\n * Computes the restricted type of this type knowing t"...
method_declaration (+61 nodes collapsed)
block_comment "/**\n * Computes the set of possible outcomes of the {@code"...
method_declaration
modifiers
public "public"
abstract "abstract"
type_identifier "BooleanLiteralSet"
identifier "getPossibleToBooleanOutcomes"
formal_parameters
( "("
) ")"
; ";"
block_comment "/**\n * Computes the subset of {@code this} and {@code that"...
method_declaration (+125 nodes collapsed)
block_comment "/**\n * Computes the subset of {@code this} and {@code that"...
method_declaration
modifiers
public "public"
type_identifier "TypePair"
identifier "getTypesUnderInequality"
formal_parameters
( "("
formal_parameter
type_identifier "JSType"
identifier "that"
) ")"
block
{ "{"
line_comment "// unions types"
if_statement (+44 nodes collapsed)
line_comment "// other types"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
this "this"
. "."
identifier "testForEquality"
argument_list
( "("
identifier "that"
) ")"
) ")"
switch_block
{ "{"
switch_block_statement_group
switch_label
case "case"
identifier "TRUE"
: ":"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "TypePair"
argument_list
( "("
null_literal "null"
, ","
null_literal "null"
) ")"
; ";"
switch_block_statement_group
switch_label
case "case"
identifier "FALSE"
: ":"
switch_block_statement_group
switch_label
case "case"
identifier "UNKNOWN"
: ":"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "TypePair"
argument_list
( "("
this "this"
, ","
identifier "that"
) ")"
; ";"
} "}"
line_comment "// switch case is exhaustive"
throw_statement
throw "throw"
object_creation_expression
new "new"
type_identifier "IllegalStateException"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Computes the subset of {@code this} and {@code that"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Computes the subset of {@code this} and {@code that"...
method_declaration (+132 nodes collapsed)
block_comment "/**\n * If this is a union type, returns a union type that "...
method_declaration
modifiers
public "public"
type_identifier "JSType"
identifier "restrictByNotNullOrUndefined"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
this "this"
; ";"
} "}"
block_comment "/**\n * Checks whether {@code this} is a subtype of {@code "...
method_declaration
modifiers
public "public"
abstract "abstract"
boolean_type "boolean"
identifier "isSubtype"
formal_parameters
( "("
formal_parameter
type_identifier "JSType"
identifier "that"
) ")"
; ";"
block_comment "/**\n * Whether this type is meaningfully different from {@"...
method_declaration (+76 nodes collapsed)
block_comment "/**\n * A generic implementation meant to be used as a help"...
method_declaration (+175 nodes collapsed)
block_comment "/**\n * Visit this type with the given visitor.\n * @see c"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Force this type to resolve, even if the registry is"...
method_declaration (+78 nodes collapsed)
block_comment "/**\n * Resolve this type in the given scope.\n *\n * The"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * @see #resolve\n */"
method_declaration (+21 nodes collapsed)
method_declaration (+24 nodes collapsed)
block_comment "/** Whether the type has been resolved. */"
method_declaration
modifiers
public "public"
final "final"
boolean_type "boolean"
identifier "isResolved"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "resolved"
; ";"
} "}"
block_comment "/** Clears the resolved field. */"
method_declaration (+24 nodes collapsed)
block_comment "/**\n * A null-safe resolve.\n * @see #resolve\n */"
method_declaration (+49 nodes collapsed)
class_declaration (+60 nodes collapsed)
block_comment "/**\n * A hash code function for diagnosing complicated iss"...
method_declaration (+33 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 "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 "JSDocInfo"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Serializable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Comparator"
; ";"
block_comment "/**\n * Represents JavaScript value types.<p>\n *\n * Types are"...
class_declaration
modifiers
public "public"
abstract "abstract"
class "class"
identifier "JSType"
super_interfaces
implements "implements"
type_list
type_identifier "Serializable"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
long "long"
variable_declarator
identifier "serialVersionUID"
= "="
decimal_integer_literal "1L"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "resolved"
= "="
false "false"
; ";"
field_declaration
modifiers
private "private"
type_identifier "JSType"
variable_declarator
identifier "resolveResult"
= "="
null_literal "null"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "UNKNOWN_NAME"
= "="
string_literal
" "\""
string_fragment "Unknown class name"
" "\""
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "NOT_A_CLASS"
= "="
string_literal
" "\""
string_fragment "Not declared as a constructor"
" "\""
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "NOT_A_TYPE"
= "="
string_literal
" "\""
string_fragment "Not declared as a type name"
" "\""
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "EMPTY_TYPE_COMPONENT"
= "="
string_literal
" "\""
string_fragment "Named type with empty name component"
" "\""
; ";"
block_comment "/**\n * Total ordering on types based on their textual repr"...
field_declaration (+70 nodes collapsed)
line_comment "// A flag set on enum definition tree nodes"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "ENUMDECL"
= "="
decimal_integer_literal "1"
; ";"
field_declaration
modifiers
public "public"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "NOT_ENUMDECL"
= "="
decimal_integer_literal "0"
; ";"
field_declaration
modifiers
final "final"
type_identifier "JSTypeRegistry"
variable_declarator
identifier "registry"
; ";"
constructor_declaration
identifier "JSType"
formal_parameters
( "("
formal_parameter
type_identifier "JSTypeRegistry"
identifier "registry"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "registry"
= "="
identifier "registry"
; ";"
} "}"
block_comment "/**\n * Utility method for less verbose code.\n */"
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Gets the docInfo for this type. By default, documen"...
method_declaration
modifiers
public "public"
type_identifier "JSDocInfo"
identifier "getJSDocInfo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * If we see a type name without braces, it might be l"...
method_declaration
void_type "void"
identifier "forgiveUnknownNames"
formal_parameters
( "("
) ")"
block
{ "{"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNoType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNoObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration (+27 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNumberObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNumberValueType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/** Whether this is the prototype of a function. */"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isFunctionPrototypeType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isStringObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
boolean_type "boolean"
identifier "isTheObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isStringValueType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Tests whether the type is a string (value or Object"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Tests whether the type is a number (value or Object"...
method_declaration (+31 nodes collapsed)
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isArrayType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isBooleanObjectType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isBooleanValueType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isRegexpType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isDateType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNullType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isVoidType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isAllType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isUnknownType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isCheckedUnknownType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isUnionType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isFunctionType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isEnumElementType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isEnumType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
boolean_type "boolean"
identifier "isNamedType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isRecordType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isTemplateType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Tests whether this type is an {@code Object}, or an"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isObject"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is a {@link FunctionType} that is"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isConstructor"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is a nominal type (a named instan"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isNominalType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is an Instance object of some con"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInstanceType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is a {@link FunctionType} that is"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isInterface"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Whether this type is a {@link FunctionType} that is"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isOrdinaryFunction"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Checks if two types are equivalent.\n */"
method_declaration (+48 nodes collapsed)
method_declaration (+50 nodes collapsed)
method_declaration (+41 nodes collapsed)
method_declaration (+26 nodes collapsed)
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
final "final"
boolean_type "boolean"
identifier "matchesInt32Context"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "matchesNumberContext"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
final "final"
boolean_type "boolean"
identifier "matchesUint32Context"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "matchesNumberContext"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "matchesNumberContext"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "matchesStringContext"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "matchesObjectContext"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Coerces this type to an Object type, then gets the "...
method_declaration (+59 nodes collapsed)
block_comment "/**\n * This predicate is used to test whether a given type"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "canBeCalled"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Tests whether values of {@code this} type can be sa"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Gets the type to which this type auto-boxes.\n *\n "...
method_declaration
modifiers
public "public"
type_identifier "JSType"
identifier "autoboxesTo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * Gets the type to which this type unboxes.\n *\n *"...
method_declaration
modifiers
public "public"
type_identifier "JSType"
identifier "unboxesTo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * Casts this to an ObjectType, or returns null if thi"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * Dereference a type for property access.\n *\n * A"...
method_declaration (+55 nodes collapsed)
block_comment "/**\n * Tests whether {@code this} and {@code that} are mea"...
method_declaration (+33 nodes collapsed)
block_comment "/**\n * Compares {@code this} and {@code that}.\n * @retur"...
method_declaration (+180 nodes collapsed)
block_comment "/**\n * Tests whether {@code this} and {@code that} are mea"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Tests whether this type is nullable.\n */"
method_declaration (+30 nodes collapsed)
block_comment "/**\n * Gets the least supertype of {@code this} and {@code"...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * A generic implementation meant to be used as a help"...
method_declaration (+71 nodes collapsed)
block_comment "/**\n * Gets the greatest subtype of {@code this} and {@cod"...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * A generic implementation meant to be used as a help"...
method_declaration (+271 nodes collapsed)
block_comment "/**\n * Computes the restricted type of this type knowing t"...
method_declaration (+61 nodes collapsed)
block_comment "/**\n * Computes the set of possible outcomes of the {@code"...
method_declaration
modifiers
public "public"
abstract "abstract"
type_identifier "BooleanLiteralSet"
identifier "getPossibleToBooleanOutcomes"
formal_parameters
( "("
) ")"
; ";"
block_comment "/**\n * Computes the subset of {@code this} and {@code that"...
method_declaration (+125 nodes collapsed)
block_comment "/**\n * Computes the subset of {@code this} and {@code that"...
method_declaration
modifiers
public "public"
type_identifier "TypePair"
identifier "getTypesUnderInequality"
formal_parameters
( "("
formal_parameter
type_identifier "JSType"
identifier "that"
) ")"
block
{ "{"
line_comment "// unions types"
if_statement (+44 nodes collapsed)
line_comment "// other types"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
this "this"
. "."
identifier "testForEquality"
argument_list
( "("
identifier "that"
) ")"
) ")"
switch_block
{ "{"
switch_block_statement_group
switch_label
case "case"
identifier "TRUE"
: ":"
local_variable_declaration
type_identifier "JSType"
variable_declarator
identifier "noType"
= "="
method_invocation
identifier "getNativeType"
argument_list
( "("
field_access
identifier "JSTypeNative"
. "."
identifier "NO_TYPE"
) ")"
; ";"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "TypePair"
argument_list
( "("
identifier "noType"
, ","
identifier "noType"
) ")"
; ";"
switch_block_statement_group
switch_label
case "case"
identifier "FALSE"
: ":"
switch_block_statement_group
switch_label
case "case"
identifier "UNKNOWN"
: ":"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "TypePair"
argument_list
( "("
this "this"
, ","
identifier "that"
) ")"
; ";"
} "}"
line_comment "// switch case is exhaustive"
throw_statement
throw "throw"
object_creation_expression
new "new"
type_identifier "IllegalStateException"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Computes the subset of {@code this} and {@code that"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Computes the subset of {@code this} and {@code that"...
method_declaration (+132 nodes collapsed)
block_comment "/**\n * If this is a union type, returns a union type that "...
method_declaration
modifiers
public "public"
type_identifier "JSType"
identifier "restrictByNotNullOrUndefined"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
this "this"
; ";"
} "}"
block_comment "/**\n * Checks whether {@code this} is a subtype of {@code "...
method_declaration
modifiers
public "public"
abstract "abstract"
boolean_type "boolean"
identifier "isSubtype"
formal_parameters
( "("
formal_parameter
type_identifier "JSType"
identifier "that"
) ")"
; ";"
block_comment "/**\n * Whether this type is meaningfully different from {@"...
method_declaration (+76 nodes collapsed)
block_comment "/**\n * A generic implementation meant to be used as a help"...
method_declaration (+175 nodes collapsed)
block_comment "/**\n * Visit this type with the given visitor.\n * @see c"...
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Force this type to resolve, even if the registry is"...
method_declaration (+78 nodes collapsed)
block_comment "/**\n * Resolve this type in the given scope.\n *\n * The"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * @see #resolve\n */"
method_declaration (+21 nodes collapsed)
method_declaration (+24 nodes collapsed)
block_comment "/** Whether the type has been resolved. */"
method_declaration
modifiers
public "public"
final "final"
boolean_type "boolean"
identifier "isResolved"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "resolved"
; ";"
} "}"
block_comment "/** Clears the resolved field. */"
method_declaration (+24 nodes collapsed)
block_comment "/**\n * A null-safe resolve.\n * @see #resolve\n */"
method_declaration (+49 nodes collapsed)
class_declaration (+60 nodes collapsed)
block_comment "/**\n * A hash code function for diagnosing complicated iss"...
method_declaration (+33 nodes collapsed)
} "}"