Lightweight JavaScript VM and stepping debugger in JavaScript.
Demo app
Blog post
With component(1):
$ component install amasad/debugjs
With npm
$ npm install amasad/debugjs
Or grab dist/bundle.js for a standalone library.
Creates and returns a Debugger.
options will be passed to the Machine constructor.
options.sandbox will be passed as the sandbox option -- see Machine
Creates a Debugger on top of the passed machine.
filename string of the filename.
liennos array of linenumbers to add breakpoints to.
filename string of the filename.
liennos array of linenumbers to remove breakpoints to.
Gets an array of breakpoints on the file filename.
Gets a sanitized call stack, with nothing but stack frames. Pass in { raw: true } to get meta call stack info.
Runs the code until it hits a breakpoint.
Steps over an instruction.
Steps into a function call.
Steps out of a function call.
Loads a file of code into the machine.
Boolean for if the machine is paused.
Boolean for if the machine is halted.
Current stsack frame.
sandbox object with references to be copied into the context.
options:
- iframeParentElement to attach the context iframe to a parent element
Compiles code as file filename and gets it ready to run.
Steps through the evaluateed code.
Calls step continuously until machine is halted
Will not let run() do anymore steps.
run() could continue running.
Gets the call stack. Note that this will include meta call stack information, like thunks etc.
See Debugger#getCallStack on how to filter non stack frame information.
Gets the current stack frame
Returns an object the latest step information (whether halted and what was yielded).
Line and column of the latest instruction ran by the machine.
Boolean stating if the machine is paused. See pause()
Boolean stating if the machine has no more instructions to run and is in idle state.
AAL. See LICENSE