UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

27 lines 1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.areBreakpointsSet = exports.checkEditorBreakpoints = exports.setBreakpointAtLine = void 0; const setBreakpointAtLine = (lines) => { breakpoints = lines; }; exports.setBreakpointAtLine = setBreakpointAtLine; let breakpoints = []; let moved = true; let prevStoppedLine = -1; const checkEditorBreakpoints = (context, node) => { if (node.loc) { const currentLine = node.loc.start.line - 1; if (!moved && currentLine !== prevStoppedLine) { moved = true; } if (context.runtime.debuggerOn && breakpoints[currentLine] !== undefined && moved) { moved = false; prevStoppedLine = currentLine; context.runtime.break = true; } } }; exports.checkEditorBreakpoints = checkEditorBreakpoints; const areBreakpointsSet = () => breakpoints.length > 0; exports.areBreakpointsSet = areBreakpointsSet; //# sourceMappingURL=inspector.js.map