Env
Env is the declaration and type environment used by the checker.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Env(
container,provider,options?,declarations?):Env
Parameters
Section titled “Parameters”container
Section titled “container”Container
provider
Section titled “provider”Registry
options?
Section titled “options?”CheckerOptions = {}
declarations?
Section titled “declarations?”Scopes = ...
Returns
Section titled “Returns”Env
Properties
Section titled “Properties”aggLitElemType
Section titled “aggLitElemType”
readonlyaggLitElemType:number
container
Section titled “container”
readonlycontainer:Container
declarations
Section titled “declarations”
readonlydeclarations:Scopes
filteredOverloadIds
Section titled “filteredOverloadIds”
readonlyfilteredOverloadIds:Set<string>
jsonFieldNames
Section titled “jsonFieldNames”
readonlyjsonFieldNames:boolean
provider
Section titled “provider”
readonlyprovider:Registry
Methods
Section titled “Methods”addFunctions()
Section titled “addFunctions()”addFunctions(…
declarations):void
addFunctions adds function declarations into the current scope.
Parameters
Section titled “Parameters”declarations
Section titled “declarations”…FunctionDecl[]
Returns
Section titled “Returns”void
addIdents()
Section titled “addIdents()”addIdents(…
declarations):void
addIdents adds variable declarations into the current scope.
Parameters
Section titled “Parameters”declarations
Section titled “declarations”…VariableDecl[]
Returns
Section titled “Returns”void
enterScope()
Section titled “enterScope()”enterScope():
Env
enterScope creates a child environment with a fresh innermost scope.
Returns
Section titled “Returns”Env
exitScope()
Section titled “exitScope()”exitScope():
Env
exitScope restores the parent declaration scope.
Returns
Section titled “Returns”Env
isOverloadDisabled()
Section titled “isOverloadDisabled()”isOverloadDisabled(
overloadId):boolean
isOverloadDisabled reports whether an overload is filtered by environment policy.
Parameters
Section titled “Parameters”overloadId
Section titled “overloadId”string
Returns
Section titled “Returns”boolean
lookupFunction()
Section titled “lookupFunction()”lookupFunction(
name):FunctionDecl|undefined
lookupFunction finds a function by container resolution order.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”FunctionDecl | undefined
resolveQualifiedIdent()
Section titled “resolveQualifiedIdent()”resolveQualifiedIdent(…
qualifiers):attributeResolution|undefined
resolveQualifiedIdent resolves a select-chain as a qualified identifier when possible.
Parameters
Section titled “Parameters”qualifiers
Section titled “qualifiers”…string[]
Returns
Section titled “Returns”attributeResolution | undefined
resolveSimpleIdent()
Section titled “resolveSimpleIdent()”resolveSimpleIdent(
name):attributeResolution|undefined
resolveSimpleIdent resolves an unqualified identifier against local and container scopes.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”attributeResolution | undefined
resolveTypeIdent()
Section titled “resolveTypeIdent()”resolveTypeIdent(
name):VariableDecl|undefined
resolveTypeIdent resolves a type name as an identifier-like declaration.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”VariableDecl | undefined
validatedDeclarations()
Section titled “validatedDeclarations()”validatedDeclarations():
Scopes
validatedDeclarations returns the declaration stack for reuse in a new environment.