# FunctionCallLicenseGate Class

Decides whether the license stops a function call, and with which #LIC! error.

The one rule behind two consumers: the interpreter, which evaluates a stopped call to that error, and the array size predictor, which sizes a stopped call as a single cell. A stopped call therefore reserves no spill range, so its #LIC! appears in its own cell only and a non-empty cell below it cannot turn it into #SPILL!. Sharing one object keeps the two from disagreeing about the same call.

Built from an engine's config, once per consumer. The license decisions are read off the config here rather than through its getters (a WeakMap lookup each), because the interpreter asks on the hottest path of evaluation. They cannot go stale: a Config never changes once built, and updateConfig builds a new engine, and with it new consumers.

# Constructors

# constructor

+ new FunctionCallLicenseGate(config: Config, functionRegistry: FunctionRegistry): FunctionCallLicenseGate

Defined in src/license/FunctionCallLicenseGate.ts:33 (opens new window)

Parameters:

Name Type Description
config Config the engine's config, holding its resolved license
functionRegistry FunctionRegistry the engine's registry, which resolves aliases

Returns: FunctionCallLicenseGate

# Methods

# stoppedCallError

▸ stoppedCallError(procedureName: string): CellError | undefined

Defined in src/license/FunctionCallLicenseGate.ts:55 (opens new window)

Returns the #LIC! error a call to the function evaluates to, or undefined when the license lets the call run. The checks run in the specification's order: a protected function always runs; a key that blocks evaluation stops every other call (C1); a key that evaluates stops a call to a function it does not grant (C2), checking an alias as its canonical function.

Parameters:

Name Type Description
procedureName string the function id as written in the formula

Returns: CellError | undefined


# stopsCall

▸ stopsCall(procedureName: string): boolean

Defined in src/license/FunctionCallLicenseGate.ts:77 (opens new window)

Whether the license stops a call to the function, so that the call evaluates to #LIC!.

Parameters:

Name Type Description
procedureName string the function id as written in the formula

Returns: boolean