(src, ctx, args)
| 10437 | kernel.registerModule(template_exports); |
| 10438 | initLiveTemplates(runtime, tokenizer, Parser, kernel, reactivity); |
| 10439 | function evaluate(src, ctx, args) { |
| 10440 | let body; |
| 10441 | if ("document" in globalScope) { |
| 10442 | body = globalScope.document.body; |
| 10443 | } else { |
| 10444 | body = new HyperscriptModule(args && args.module); |
| 10445 | } |
| 10446 | ctx = Object.assign(runtime.makeContext(body, null, body, null), ctx || {}); |
| 10447 | let element = kernel.parse(tokenizer, src); |
| 10448 | if (element && element.errors && element.errors.length > 0) { |
| 10449 | throw new Error(element.errors[0].message + "\n\n" + Parser.formatErrors(element.errors)); |
| 10450 | } |
| 10451 | if (element.execute) { |
| 10452 | element.execute(ctx); |
| 10453 | return ctx.meta.returnValue !== void 0 ? ctx.meta.returnValue : ctx.result; |
| 10454 | } else if (element.apply) { |
| 10455 | element.apply(body, body, args, runtime); |
| 10456 | return runtime.getHyperscriptFeatures(body); |
| 10457 | } else { |
| 10458 | return element.evaluate(ctx); |
| 10459 | } |
| 10460 | } |
| 10461 | var _hyperscript = Object.assign( |
| 10462 | evaluate, |
| 10463 | { |
nothing calls this directly
no test coverage detected