interface Declaration

A declaration made at a breakpoint: what it binds, to what, and how long it should last.

Properties

name: string

The name it binds.

value: string

The expression its value comes from, to be evaluated where the input was typed.

blockScoped: boolean

Whether it belongs to the block it was written in — let, const and class do.

What decides its fate when the page carries on: block-scoped names were written inside the block the breakpoint stopped in and go when it does, while var and function are the ones JavaScript hoists out of blocks and everyone expects to still be there afterwards.

Usage

import { type Declaration } from "lib/repl/input.ts";