(e)
| 1 | (()=>{var d=class t{errors=[];collectErrors(e){if(e||(e=new Set),e.has(this))return[];e.add(this);var o=[...this.errors];for(var n of Object.keys(this))for(var s of[this[n]].flat())s instanceof t&&o.push(...s.collectErrors(e));return o}sourceFor(){return this.programSource.substring(this.startToken.start,this.endToken.end)}lineFor(){return this.programSource.split(` |
| 2 | `)[this.startToken.line-1]}static parseEventArgs(e){var o=[];if(e.token(0).value==="("&&(e.token(1).value===")"||e.token(2).value===","||e.token(2).value===")")){e.matchOpToken("(");do o.push(e.requireTokenType("IDENTIFIER"));while(e.matchOpToken(","));e.requireOpToken(")")}return o}};var c=class extends d{constructor(){super(),this.constructor.keyword&&(this.type=this.constructor.keyword+"Command")}execute(e){return e.meta.command=this,e.meta.runtime.unifiedExec(this,e)}findNext(e){return e.meta.runtime.findNext(this,e)}};var a=class t extends c{static keyword="breakpoint";static parse(e){if(e.matchToken("breakpoint"))return new t}resolve(e){var o;globalThis.hdb=o=new r(e,e.meta.runtime,this);try{return o.break(e)}catch(n){console.error(n,n.stack)}}};function r(t,e,o){this.ctx=t,this.runtime=e,this.cmd=o,this._hyperscript=self._hyperscript,this.cmdMap=[],this.bus=new EventTarget}r.prototype.break=function(t){return console.log("=== HDB///_hyperscript/debugger ==="),this.ui(),new Promise((e,o)=>{this.bus.addEventListener("continue",()=>{if(this.ctx!==t){for(var n in t)delete t[n];Object.assign(t,this.ctx)}delete globalThis.hdb,e(this.runtime.findNext(this.cmd,this.ctx))},{once:!0})})};r.prototype.continueExec=function(){this.bus.dispatchEvent(new Event("continue"))};r.prototype.stepOver=function(){if(!this.cmd)return this.continueExec();var t=this.cmd&&this.cmd.type==="breakpointCommand"?this.runtime.findNext(this.cmd,this.ctx):this.runtime.unifiedEval(this.cmd,this.ctx);if(t.type==="implicitReturn")return this.stepOut();if(t&&t.then instanceof Function)return t.then(e=>{this.cmd=e,this.bus.dispatchEvent(new Event("step")),this.logCommand()});t.halt_flag?this.bus.dispatchEvent(new Event("continue")):(this.cmd=t,this.bus.dispatchEvent(new Event("step")),this.logCommand())};r.prototype.stepOut=function(){if(!this.ctx.meta.caller)return this.continueExec();var t=this.ctx.meta.callingCommand,e=this.ctx.me;this.ctx=this.ctx.meta.caller,console.log("[hdb] stepping out into "+this.ctx.meta.feature.displayName),this.ctx.me instanceof Element&&this.ctx.me!==e&&console.log("[hdb] me: ",this.ctx.me),this.cmd=this.runtime.findNext(t,this.ctx),this.cmd=this.runtime.findNext(this.cmd,this.ctx),this.logCommand(),this.bus.dispatchEvent(new Event("step"))};r.prototype.skipTo=function(t){this.cmd=t.cmd,this.bus.dispatchEvent(new Event("skip"))};r.prototype.rewrite=function(t,e){console.log("##",t);let o=t.cmd.parent,n;for(n of o.children)if(n.next===t.cmd)break;let s=t.next,u=this._hyperscript.internals.tokenizer.tokenize(e),i=this._hyperscript.internals.createParser(u).requireElement("command");console.log(i),i.startToken=t.startToken,i.endToken=t.endToken,i.programSource=t.programSource,i.sourceFor=function(){return e},n.next=i,i.next=s,i.parent=o,this.bus.dispatchEvent(new Event("step"))};r.prototype.logCommand=function(){var t=this.cmd.sourceFor instanceof Function,e=t?this.cmd.sourceFor():"-- "+this.cmd.type;console.log("[hdb] current command: "+e)};r.prototype.traverse=function(t){let e=[];return(function o(n){if(e.push(n),"children"in n)for(let s of n.children)o(s)})(t),e};var h=` |
| 3 | <div class="hdb" _=" |
| 4 | on load trigger update end |
| 5 | on step from hdb.bus trigger update end |
no test coverage detected