MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / cmdUntil

Method cmdUntil

tools/xsbug-log/xsbug-debugmachine.js:1568–1605  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

1566 }
1567
1568 cmdUntil(args) {
1569 if (!this.requireBroken()) {
1570 this.showPrompt();
1571 return;
1572 }
1573 if (args.length < 1) {
1574 this.commandError('Syntax: until <line> | until <function>');
1575 return;
1576 }
1577
1578 const spec = args[0];
1579 let path = this.currentPath;
1580 let line;
1581
1582 if (!isNaN(parseInt(spec))) {
1583 line = parseInt(spec);
1584 if (!path) {
1585 this.commandError('No current file.');
1586 return;
1587 }
1588 }
1589 else {
1590 // Function until
1591 path = spec;
1592 line = 0;
1593 }
1594
1595 // Clear any previous temporary breakpoint
1596 if (this.temporaryBreakpoint) {
1597 this.doClearBreakpoint(this.temporaryBreakpoint.path, this.temporaryBreakpoint.line);
1598 }
1599
1600 this.temporaryBreakpoint = { path, line };
1601 this.doSetBreakpoint(path, line);
1602
1603 this.resume();
1604 this.doGo();
1605 }
1606
1607
1608 // Build protocol options {condition, hitCount, trace} from a breakpoint's stored expressions.

Callers 1

handleCommandMethod · 0.95

Calls 7

requireBrokenMethod · 0.95
showPromptMethod · 0.95
commandErrorMethod · 0.95
resumeMethod · 0.95
doSetBreakpointMethod · 0.80
doGoMethod · 0.80
doClearBreakpointMethod · 0.45

Tested by

no test coverage detected