From 6ea40a66da1d1bc030ab0a0f6cb776db4f17b579 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 15 Nov 2021 15:01:56 +0100 Subject: [PATCH] [IMP] app, compiler: introduce t-out t-out automatically escaped content when it is a string not marked with the `markup` function t-out renders the raw content if it is a Block, or if it has been marked with the `markup` funtion. t-esc has been kept since it is safe and is optimized to render text nodes. all t-raw calls are in fact the same as t-out. --- src/app/template_helpers.ts | 26 ++ src/compiler/code_generator.ts | 14 +- src/compiler/parser.ts | 38 +- src/index.ts | 3 +- src/reactivity.ts | 4 +- src/utils.ts | 15 + tests/__snapshots__/reactivity.test.ts.snap | 44 +- .../__snapshots__/attributes.test.ts.snap | 94 ++-- .../__snapshots__/comments.test.ts.snap | 6 +- .../__snapshots__/error_handling.test.ts.snap | 2 +- .../__snapshots__/event_handling.test.ts.snap | 70 +-- .../compiler/__snapshots__/misc.test.ts.snap | 16 +- .../__snapshots__/qweb_memory.test.ts.snap | 2 +- .../simple_templates.test.ts.snap | 54 +-- .../__snapshots__/t_call.test.ts.snap | 144 +++--- .../__snapshots__/t_debug_log.test.ts.snap | 8 +- .../compiler/__snapshots__/t_esc.test.ts.snap | 24 +- .../__snapshots__/t_foreach.test.ts.snap | 36 +- .../compiler/__snapshots__/t_if.test.ts.snap | 50 +- .../compiler/__snapshots__/t_key.test.ts.snap | 8 +- .../compiler/__snapshots__/t_out.test.ts.snap | 432 ++++++++++++++++++ .../compiler/__snapshots__/t_raw.test.ts.snap | 182 -------- .../compiler/__snapshots__/t_ref.test.ts.snap | 14 +- .../compiler/__snapshots__/t_set.test.ts.snap | 62 +-- .../compiler/__snapshots__/t_tag.test.ts.snap | 16 +- .../__snapshots__/template_set.test.ts.snap | 12 +- .../__snapshots__/translation.test.ts.snap | 10 +- .../__snapshots__/white_space.test.ts.snap | 12 +- tests/compiler/event_handling.test.ts | 7 +- tests/compiler/misc.test.ts | 4 +- tests/compiler/parser.test.ts | 44 +- tests/compiler/t_call.test.ts | 20 +- tests/compiler/t_out.test.ts | 239 ++++++++++ tests/compiler/t_raw.test.ts | 86 ---- tests/compiler/t_set.test.ts | 6 +- .../components/__snapshots__/app.test.ts.snap | 2 +- .../__snapshots__/basics.test.ts.snap | 172 +++---- .../__snapshots__/concurrency.test.ts.snap | 150 +++--- .../__snapshots__/error_handling.test.ts.snap | 66 +-- .../__snapshots__/event_handling.test.ts.snap | 8 +- .../higher_order_component.test.ts.snap | 26 +- .../__snapshots__/hooks.test.ts.snap | 34 +- .../__snapshots__/lifecycle.test.ts.snap | 108 ++--- .../__snapshots__/props.test.ts.snap | 26 +- .../props_validation.test.ts.snap | 62 +-- .../__snapshots__/reactivity.test.ts.snap | 10 +- .../__snapshots__/refs.test.ts.snap | 6 +- .../__snapshots__/slots.test.ts.snap | 236 +++++----- .../__snapshots__/style_class.test.ts.snap | 70 +-- .../__snapshots__/t_call.test.ts.snap | 38 +- .../__snapshots__/t_call_block.test.ts.snap | 2 +- .../__snapshots__/t_component.test.ts.snap | 34 +- .../__snapshots__/t_foreach.test.ts.snap | 36 +- .../__snapshots__/t_key.test.ts.snap | 28 +- .../__snapshots__/t_model.test.ts.snap | 38 +- .../__snapshots__/t_on.test.ts.snap | 12 +- .../__snapshots__/t_props.test.ts.snap | 16 +- .../__snapshots__/t_set.test.ts.snap | 16 +- tests/components/basics.test.ts | 18 +- tests/components/props.test.ts | 4 +- tests/misc/__snapshots__/memo.test.ts.snap | 10 +- tests/misc/__snapshots__/portal.test.ts.snap | 54 +-- 62 files changed, 1780 insertions(+), 1306 deletions(-) create mode 100644 tests/compiler/__snapshots__/t_out.test.ts.snap delete mode 100644 tests/compiler/__snapshots__/t_raw.test.ts.snap create mode 100644 tests/compiler/t_out.test.ts delete mode 100644 tests/compiler/t_raw.test.ts diff --git a/src/app/template_helpers.ts b/src/app/template_helpers.ts index ba815896..8cbf2133 100644 --- a/src/app/template_helpers.ts +++ b/src/app/template_helpers.ts @@ -1,5 +1,7 @@ import { BDom, multi, text, toggler } from "../blockdom"; import { validateProps } from "../component/props_validation"; +import { Markup } from "../utils"; +import { html } from "../blockdom/index"; /** * This file contains utility functions that will be injected in each template, @@ -94,6 +96,29 @@ function shallowEqual(l1: any[], l2: any[]): boolean { return true; } +/* + * Safely outputs `value` as a block depending on the nature of `value` + */ +export function safeOutput(value: any): ReturnType { + if (!value) { + return value; + } + let safeKey; + let block; + if (value instanceof Markup) { + safeKey = `string_safe`; + block = html(value as string); + } else if (typeof value === "string") { + safeKey = "string_unsafe"; + block = text(value); + } else { + // Assuming it is a block + safeKey = "block_safe"; + block = value; + } + return toggler(safeKey, block); +} + export const UTILS = { withDefault, zero: Symbol("zero"), @@ -106,4 +131,5 @@ export const UTILS = { shallowEqual, toNumber, validateProps, + safeOutput, }; diff --git a/src/compiler/code_generator.ts b/src/compiler/code_generator.ts index b8576e36..fdf540d1 100644 --- a/src/compiler/code_generator.ts +++ b/src/compiler/code_generator.ts @@ -15,7 +15,7 @@ import { ASTTForEach, ASTTif, ASTTKey, - ASTTRaw, + ASTTOut, ASTTSet, ASTTranslation, ASTType, @@ -208,7 +208,7 @@ export class CodeGenerator { // define blocks and utility functions this.addLine(`let { text, createBlock, list, multi, html, toggler, component } = bdom;`); this.addLine( - `let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers;` + `let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;` ); if (this.shouldDefineAssign) { this.addLine(`let assign = Object.assign;`); @@ -377,8 +377,8 @@ export class CodeGenerator { case ASTType.TEsc: this.compileTEsc(ast, ctx); break; - case ASTType.TRaw: - this.compileTRaw(ast, ctx); + case ASTType.TOut: + this.compileTOut(ast, ctx); break; case ASTType.TIf: this.compileTIf(ast, ctx); @@ -640,20 +640,20 @@ export class CodeGenerator { } } - compileTRaw(ast: ASTTRaw, ctx: Context) { + compileTOut(ast: ASTTOut, ctx: Context) { let { block } = ctx; if (block) { this.insertAnchor(block); } block = this.createBlock(block, "html", ctx); - let expr = ast.expr === "0" ? "ctx[zero]" : compileExpr(ast.expr); + let expr = ast.expr === "0" ? "ctx[zero]" : `safeOutput(${compileExpr(ast.expr)})`; if (ast.body) { const nextId = BlockDescription.nextBlockId; const subCtx: Context = createContext(ctx); this.compileAST({ type: ASTType.Multi, content: ast.body }, subCtx); expr = `withDefault(${expr}, b${nextId})`; } - this.insertBlock(`html(${expr})`, block, ctx); + this.insertBlock(`${expr}`, block, ctx); } compileTIf(ast: ASTTif, ctx: Context, nextNode?: ASTDomNode) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 2c9ae62c..a70bb2f4 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -11,7 +11,7 @@ export const enum ASTType { TIf, TSet, TCall, - TRaw, + TOut, TForEach, TKey, TComponent, @@ -62,8 +62,8 @@ export interface ASTTEsc { defaultValue: string; } -export interface ASTTRaw { - type: ASTType.TRaw; +export interface ASTTOut { + type: ASTType.TOut; expr: string; body: AST[] | null; } @@ -156,7 +156,7 @@ export type AST = | ASTTif | ASTTSet | ASTTCall - | ASTTRaw + | ASTTOut | ASTTForEach | ASTTKey | ASTComponent @@ -197,7 +197,7 @@ function parseNode(node: ChildNode, ctx: ParsingContext): AST | null { parseTKey(node, ctx) || parseTTranslation(node, ctx) || parseTSlot(node, ctx) || - parseTRawNode(node, ctx) || + parseTOutNode(node, ctx) || parseComponent(node, ctx) || parseDOMNode(node, ctx) || parseTSetNode(node, ctx) || @@ -419,33 +419,39 @@ function parseTEscNode(node: Element, ctx: ParsingContext): AST | null { } // ----------------------------------------------------------------------------- -// t-raw +// t-out // ----------------------------------------------------------------------------- -function parseTRawNode(node: Element, ctx: ParsingContext): AST | null { - if (!node.hasAttribute("t-raw")) { +function parseTOutNode(node: Element, ctx: ParsingContext): AST | null { + if (!node.hasAttribute("t-out") && !node.hasAttribute("t-raw")) { return null; } - const expr = node.getAttribute("t-raw")!; + if (node.hasAttribute("t-raw")) { + console.warn( + `t-raw has been deprecated in favor of t-out. If the value to render is not wrapped by the "markup" function, it will be escaped` + ); + } + const expr = (node.getAttribute("t-out") || node.getAttribute("t-raw"))!; + node.removeAttribute("t-out"); node.removeAttribute("t-raw"); - const tRaw: AST = { type: ASTType.TRaw, expr, body: null }; + const tOut: AST = { type: ASTType.TOut, expr, body: null }; const ref = node.getAttribute("t-ref"); node.removeAttribute("t-ref"); const ast = parseNode(node, ctx); if (!ast) { - return tRaw; + return tOut; } - if (ast && ast.type === ASTType.DomNode) { - tRaw.body = ast.content.length ? ast.content : null; + if (ast.type === ASTType.DomNode) { + tOut.body = ast.content.length ? ast.content : null; return { ...ast, ref, - content: [tRaw], + content: [tOut], }; } - return tRaw; + return tOut; } // ----------------------------------------------------------------------------- @@ -504,7 +510,7 @@ function parseTForEach(node: Element, ctx: ParsingContext): AST | null { function hasNoComponent(ast: AST): boolean { switch (ast.type) { case ASTType.TComponent: - case ASTType.TRaw: + case ASTType.TOut: case ASTType.TCall: case ASTType.TCallBlock: case ASTType.TSlot: diff --git a/src/index.ts b/src/index.ts index e46bf8ac..41e2ae9f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,6 @@ import { toggler, } from "./blockdom"; import { mainEventHandler } from "./component/handler"; -import { EventBus, whenReady, loadFile } from "./utils"; config.shouldNormalizeDom = false; config.mainEventHandler = mainEventHandler; @@ -58,7 +57,7 @@ export { Memo } from "./misc/memo"; export { css, xml } from "./tags"; export { useState } from "./reactivity"; export { useEffect, useEnv, useExternalListener, useRef, useSubEnv } from "./hooks"; -export const utils = { EventBus, whenReady, loadFile }; +export { EventBus, whenReady, loadFile, markup } from "./utils"; export { onWillStart, diff --git a/src/reactivity.ts b/src/reactivity.ts index 938e3c60..7521d754 100644 --- a/src/reactivity.ts +++ b/src/reactivity.ts @@ -128,7 +128,9 @@ function isTrackable(value: any): boolean { value !== null && typeof value === "object" && !(value instanceof Date) && - !(value instanceof Promise) + !(value instanceof Promise) && + !(value instanceof String) && + !(value instanceof Number) ); } diff --git a/src/utils.ts b/src/utils.ts index 160bde91..4ccdd2b2 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -21,3 +21,18 @@ export async function loadFile(url: string): Promise { } return await result.text(); } + +/* + * This class just transports the fact that a string is safe + * to be injected as HTML. Overriding a JS primitive is quite painful though + * so we need to redfine toString and valueOf. + */ +export class Markup extends String {} + +/* + * Marks a value as safe, that is, a value that can be injected as HTML directly. + * It should be used to wrap the value passed to a t-out directive to allow a raw rendering. + */ +export function markup(value: any) { + return new Markup(value); +} diff --git a/tests/__snapshots__/reactivity.test.ts.snap b/tests/__snapshots__/reactivity.test.ts.snap index 0b5f00cc..2a39c00a 100644 --- a/tests/__snapshots__/reactivity.test.ts.snap +++ b/tests/__snapshots__/reactivity.test.ts.snap @@ -4,7 +4,7 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -19,7 +19,7 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -37,7 +37,7 @@ exports[`Reactivity: useState destroyed component is inactive 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -52,7 +52,7 @@ exports[`Reactivity: useState destroyed component is inactive 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -70,7 +70,7 @@ exports[`Reactivity: useState one components can subscribe twice to same context "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -86,7 +86,7 @@ exports[`Reactivity: useState parent and children subscribed to same context 1`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -101,7 +101,7 @@ exports[`Reactivity: useState parent and children subscribed to same context 2`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -117,7 +117,7 @@ exports[`Reactivity: useState several nodes on different level use same context "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -133,7 +133,7 @@ exports[`Reactivity: useState several nodes on different level use same context "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -148,7 +148,7 @@ exports[`Reactivity: useState several nodes on different level use same context "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -164,7 +164,7 @@ exports[`Reactivity: useState several nodes on different level use same context "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -180,7 +180,7 @@ exports[`Reactivity: useState two components are updated in parallel 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -195,7 +195,7 @@ exports[`Reactivity: useState two components are updated in parallel 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -211,7 +211,7 @@ exports[`Reactivity: useState two components can subscribe to same context 1`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -226,7 +226,7 @@ exports[`Reactivity: useState two components can subscribe to same context 2`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -242,7 +242,7 @@ exports[`Reactivity: useState two independent components on different levels are "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -257,7 +257,7 @@ exports[`Reactivity: useState two independent components on different levels are "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -272,7 +272,7 @@ exports[`Reactivity: useState two independent components on different levels are "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -288,7 +288,7 @@ exports[`Reactivity: useState useContext=useState hook is reactive, for one comp "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -303,7 +303,7 @@ exports[`Reactivity: useState useless atoms should be deleted 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -318,7 +318,7 @@ exports[`Reactivity: useState useless atoms should be deleted 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
Total: Count:
\`); @@ -343,7 +343,7 @@ exports[`Reactivity: useState very simple use, with initial value 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/compiler/__snapshots__/attributes.test.ts.snap b/tests/compiler/__snapshots__/attributes.test.ts.snap index 6432221a..bc23ac7f 100644 --- a/tests/compiler/__snapshots__/attributes.test.ts.snap +++ b/tests/compiler/__snapshots__/attributes.test.ts.snap @@ -4,7 +4,7 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -19,7 +19,7 @@ exports[`attributes changing a class with t-att-class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -34,7 +34,7 @@ exports[`attributes changing an attribute with t-att- 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -49,7 +49,7 @@ exports[`attributes class and t-att-class should combine together 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -64,7 +64,7 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -79,7 +79,7 @@ exports[`attributes dynamic attribute evaluating to 0 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -94,7 +94,7 @@ exports[`attributes dynamic attribute falsy variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -109,7 +109,7 @@ exports[`attributes dynamic attribute with a dash 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -124,7 +124,7 @@ exports[`attributes dynamic attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -139,7 +139,7 @@ exports[`attributes dynamic class attribute 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -154,7 +154,7 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -169,7 +169,7 @@ exports[`attributes dynamic empty class attribute 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -184,7 +184,7 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -199,7 +199,7 @@ exports[`attributes fixed variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -214,7 +214,7 @@ exports[`attributes format expression 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -229,7 +229,7 @@ exports[`attributes format literal 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -244,7 +244,7 @@ exports[`attributes format multiple 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -259,7 +259,7 @@ exports[`attributes format value 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -274,7 +274,7 @@ exports[`attributes from object variables set previously 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -292,7 +292,7 @@ exports[`attributes from variables set previously (no external node) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -310,7 +310,7 @@ exports[`attributes from variables set previously 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -328,7 +328,7 @@ exports[`attributes object 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -343,7 +343,7 @@ exports[`attributes static attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -357,7 +357,7 @@ exports[`attributes static attributes on void elements 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\\"Test\\"/\`); @@ -371,7 +371,7 @@ exports[`attributes static attributes with dashes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -385,7 +385,7 @@ exports[`attributes t-att-class and class should combine together 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -400,7 +400,7 @@ exports[`attributes t-att-class with multiple classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -415,7 +415,7 @@ exports[`attributes t-att-class with multiple classes 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -430,7 +430,7 @@ exports[`attributes t-att-class with multiple classes, some of which are duplica "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -445,7 +445,7 @@ exports[`attributes t-att-class with object 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -460,7 +460,7 @@ exports[`attributes t-attf-class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -475,7 +475,7 @@ exports[`attributes t-attf-class should combine with class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -490,7 +490,7 @@ exports[`attributes t-attf-class with multiple classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -505,7 +505,7 @@ exports[`attributes t-attf-class with multiple classes separated by multiple spa "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -520,7 +520,7 @@ exports[`attributes tuple literal 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -535,7 +535,7 @@ exports[`attributes tuple variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -550,7 +550,7 @@ exports[`attributes two classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -564,7 +564,7 @@ exports[`attributes two dynamic attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -580,7 +580,7 @@ exports[`attributes updating classes (with obj notation) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -595,7 +595,7 @@ exports[`attributes various escapes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -612,7 +612,7 @@ exports[`attributes various escapes 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
<
\`); @@ -626,7 +626,7 @@ exports[`special cases for some specific html attributes/properties input of typ "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -641,7 +641,7 @@ exports[`special cases for some specific html attributes/properties input type= "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -656,7 +656,7 @@ exports[`special cases for some specific html attributes/properties input with t "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -671,7 +671,7 @@ exports[`special cases for some specific html attributes/properties select with "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -686,7 +686,7 @@ exports[`special cases for some specific html attributes/properties textarea wit "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`