import { VM } from '../../vm'; import { CompiledExpression } from '../expressions'; import { Primitive, PrimitiveReference } from '../../references'; export default class CompiledValue extends CompiledExpression { public type = "value"; private reference: PrimitiveReference; constructor(value: T) { super(); this.reference = PrimitiveReference.create(value); } evaluate(_vm: VM): PrimitiveReference { return this.reference; } toJSON(): string { return JSON.stringify(this.reference.value()); } }