MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / registerCommands

Function registerCommands

debug-plugin/content-script.js:30–55  ·  view source on GitHub ↗
(_hs)

Source from the content-addressed store, hash-verified

28 });
29
30 function registerCommands(_hs) {
31 _hs.addCommand("breakpoint", function (parser) {
32 if (!parser.matchToken("breakpoint")) return;
33
34 return {
35 type: "breakpointCommand",
36 execute: function (ctx) {
37 ctx.meta.command = this;
38 return ctx.meta.runtime.unifiedExec(this, ctx);
39 },
40 resolve: function (ctx) {
41 globalThis._hyperscript.hdb = HDB(ctx, ctx.meta.runtime, this, _hs);
42
43 if (!_hs.debuggerOpen) {
44 return ctx.meta.runtime.findNext(this, ctx);
45 }
46
47 try {
48 return globalThis._hyperscript.hdb.break(ctx);
49 } catch (e) {
50 console.error(e, e.stack);
51 }
52 },
53 };
54 });
55 }
56
57 function escapeHTML(unsafe) {
58 return unsafe

Callers 1

content-script.jsFile · 0.85

Calls 5

HDBFunction · 0.70
addCommandMethod · 0.45
matchTokenMethod · 0.45
unifiedExecMethod · 0.45
findNextMethod · 0.45

Tested by

no test coverage detected