js-slang
Version:
Javascript-based implementations of Source, written in Typescript
27 lines (26 loc) • 1.08 kB
TypeScript
import * as es from 'estree';
import { Context, Environment } from '../types';
declare class Callable extends Function {
constructor(f: any);
}
/**
* Models function value in the interpreter environment.
*/
export default class Closure extends Callable {
node: es.Function | es.ArrowFunctionExpression;
environment: Environment;
static makeFromArrowFunction(node: es.ArrowFunctionExpression, environment: Environment, context: Context, dummyReturn?: boolean, predefined?: boolean): Closure;
/** Unique ID defined for closure */
readonly id: string;
/** String representation of the closure */
functionName: string;
/** Fake closure function */
fun: Function;
/** Keeps track of whether the closure is a pre-defined function */
preDefined?: boolean;
/** The original node that created this Closure */
originalNode: es.Function | es.ArrowFunctionExpression;
constructor(node: es.Function | es.ArrowFunctionExpression, environment: Environment, context: Context, isPredefined?: boolean);
toString(): string;
}
export {};