Skip to content
프로젝트

소개

[Experimental] Lightweight JavaScript VM and stepping debugger in JavaScript

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

debugjs

Lightweight JavaScript VM and stepping debugger in JavaScript.
Demo app
Blog post

Installation

With component(1):

$ component install amasad/debugjs

With npm

$ npm install amasad/debugjs

Or grab dist/bundle.js for a standalone library.

API

debugjs.createDebugger(options)

Creates and returns a Debugger. options will be passed to the Machine constructor. options.sandbox will be passed as the sandbox option -- see Machine

Debugger

new Debugger(machine)

Creates a Debugger on top of the passed machine.

Debugger#addBreakpoints(filename, linenos)

filename string of the filename. liennos array of linenumbers to add breakpoints to.

Debugger#removeBreakpoint(filename, linenos)

filename string of the filename. liennos array of linenumbers to remove breakpoints to.

Debugger#getBreakpoints(filename)

Gets an array of breakpoints on the file filename.

Debugger#getCallStack(options)

Gets a sanitized call stack, with nothing but stack frames. Pass in { raw: true } to get meta call stack info.

Debugger#run()

Runs the code until it hits a breakpoint.

Debugger#stepOver()

Steps over an instruction.

Debugger#stepIn()

Steps into a function call.

Debugger#stepOut()

Steps out of a function call.

Debugger#load(code, filename)

Loads a file of code into the machine.

Debugger#paused()

Boolean for if the machine is paused.

Debugger#halted()

Boolean for if the machine is halted.

Debugger#getCurrentStackFrame()

Current stsack frame.

Machine

new Machine(sandbox, options)

sandbox object with references to be copied into the context. options:

  • iframeParentElement to attach the context iframe to a parent element

Machine#evaluate(code, filename)

Compiles code as file filename and gets it ready to run.

Machine#step()

Steps through the evaluateed code.

Machine#run()

Calls step continuously until machine is halted

Machine#pause()

Will not let run() do anymore steps.

Machine#resume()

run() could continue running.

Machine#getCallStack()

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.

Machine#getCurrentStackFrame()

Gets the current stack frame

Machine#getState()

Returns an object the latest step information (whether halted and what was yielded).

Machine#getCurrentLoc()

Line and column of the latest instruction ran by the machine.

Machine#paused

Boolean stating if the machine is paused. See pause()

Machine#halted

Boolean stating if the machine has no more instructions to run and is in idle state.

License

AAL. See LICENSE

관련 프로젝트 살펴보기

불러오는 중…