mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2068196377 |
@@ -124,5 +124,5 @@ npm install @odoo/owl
|
||||
|
||||
If you want to use a simple `<script>` tag, the last release can be downloaded here:
|
||||
|
||||
- [owl](https://github.com/odoo/owl/releases/latest)
|
||||
- [owl-1.4.10](https://github.com/odoo/owl/releases/tag/v1.4.10)
|
||||
|
||||
|
||||
@@ -770,11 +770,10 @@ For reference, here is the final code:
|
||||
<meta charset="UTF-8" />
|
||||
<title>OWL Todo App</title>
|
||||
<link rel="stylesheet" href="app.css" />
|
||||
</head>
|
||||
<body>
|
||||
<script src="owl.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
@@ -234,8 +234,7 @@ are defined by a function instead of just the dependencies.
|
||||
|
||||
The `useEffect` hook takes two function: the effect function and the dependency
|
||||
function. The effect function perform some task and return (optionally) a cleanup
|
||||
function. The dependency function returns a list of dependencies, these dependencies
|
||||
are passed as parameters in the effect function . If any of these
|
||||
function. The dependency function returns a list of dependencies. If any of these
|
||||
dependencies changes, then the current effect will be cleaned up and reexecuted.
|
||||
|
||||
Here is an example without any dependencies:
|
||||
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "@odoo/owl",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.0-beta-10",
|
||||
"description": "Odoo Web Library (OWL)",
|
||||
"main": "dist/owl.cjs.js",
|
||||
"browser": "dist/owl.iife.js",
|
||||
"module": "dist/owl.es.js",
|
||||
"types": "dist/types/owl.d.ts",
|
||||
"files": [
|
||||
|
||||
+23
-4
@@ -1,9 +1,28 @@
|
||||
# 🦉 OWL Roadmap 🦉
|
||||
|
||||
- Current version: 2.X
|
||||
- Current version: 1.4.10
|
||||
- Status: stable
|
||||
|
||||
Owl is currently stable. No (large) improvements is expected in the near future.
|
||||
This roadmap is only an attempt at predicting Owl's future. Everything may
|
||||
change!
|
||||
|
||||
|
||||
### 1.x
|
||||
|
||||
- add chrome and firefox devtools,
|
||||
- fix every bugs,
|
||||
- improve documentation,
|
||||
- small backward compatible improvements.
|
||||
|
||||
### 2.x (2020? 2021? 2022?)
|
||||
|
||||
- stop support for `t-set` directive to define the content of a slot
|
||||
|
||||
Maybe:
|
||||
|
||||
- reimplement vdom to use *block* system, like Vue 3, which should make Owl
|
||||
much faster
|
||||
- refactor `QWeb` to use an intermediate representation (some kind of AST) to
|
||||
allow additional optimisations.
|
||||
|
||||
|
||||
Note that we intend to keep maintaining owl, and as such, improvements and/or
|
||||
breaking changes may require a version bump in the future.
|
||||
|
||||
+8
-16
@@ -6,14 +6,6 @@ import dts from "rollup-plugin-dts";
|
||||
|
||||
let input, output;
|
||||
|
||||
const IIFE_FILENAME = "dist/owl.iife.js";
|
||||
const CJS_FILENAME = "dist/owl.cjs.js";
|
||||
const ES_FILENAME = "dist/owl.es.js";
|
||||
|
||||
if (pkg.module !== ES_FILENAME || pkg.main !== CJS_FILENAME) {
|
||||
throw new Error("package.json has been modified. Build script should be updated accordingly");
|
||||
}
|
||||
|
||||
const outro = `
|
||||
__info__.version = '${pkg.version}';
|
||||
__info__.date = '${new Date().toISOString()}';
|
||||
@@ -31,19 +23,19 @@ switch (process.argv[4]) {
|
||||
case "runtime":
|
||||
input = "src/runtime/index.ts";
|
||||
output = [
|
||||
getConfigForFormat('esm', addSuffix(ES_FILENAME, 'runtime'), outro),
|
||||
getConfigForFormat('cjs', addSuffix(CJS_FILENAME, 'runtime'), outro),
|
||||
getConfigForFormat('iife', addSuffix(IIFE_FILENAME, 'runtime'), outro),
|
||||
getConfigForFormat('iife', addSuffix(IIFE_FILENAME, 'runtime'), outro, true),
|
||||
getConfigForFormat('esm', addSuffix(pkg.module, 'runtime'), outro),
|
||||
getConfigForFormat('cjs', addSuffix(pkg.main, 'runtime'), outro),
|
||||
getConfigForFormat('iife', addSuffix(pkg.browser, 'runtime'), outro),
|
||||
getConfigForFormat('iife', addSuffix(pkg.browser, 'runtime'), outro, true),
|
||||
]
|
||||
break;
|
||||
default:
|
||||
input = "src/index.ts",
|
||||
output = [
|
||||
getConfigForFormat('esm', ES_FILENAME, outro),
|
||||
getConfigForFormat('cjs', CJS_FILENAME, outro),
|
||||
getConfigForFormat('iife', IIFE_FILENAME, outro),
|
||||
getConfigForFormat('iife', IIFE_FILENAME, outro, true),
|
||||
getConfigForFormat('esm', pkg.module, outro),
|
||||
getConfigForFormat('cjs', pkg.main, outro),
|
||||
getConfigForFormat('iife', pkg.browser, outro),
|
||||
getConfigForFormat('iife', pkg.browser, outro, true),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
+122
-154
@@ -1,4 +1,3 @@
|
||||
import { isProp } from "../runtime/blockdom/attributes";
|
||||
import {
|
||||
compileExpr,
|
||||
compileExprToArray,
|
||||
@@ -23,14 +22,13 @@ import {
|
||||
ASTTif,
|
||||
ASTTKey,
|
||||
ASTTOut,
|
||||
ASTTPortal,
|
||||
ASTTranslation,
|
||||
ASTTSet,
|
||||
ASTTranslation,
|
||||
ASTType,
|
||||
Attrs,
|
||||
ASTTPortal,
|
||||
EventHandlers,
|
||||
Attrs,
|
||||
} from "./parser";
|
||||
import { OwlError } from "../runtime/error_handling";
|
||||
|
||||
type BlockType = "block" | "text" | "multi" | "list" | "html" | "comment";
|
||||
|
||||
@@ -145,7 +143,7 @@ interface Context {
|
||||
ctxVar?: string;
|
||||
}
|
||||
|
||||
function createContext(parentCtx: Context, params?: Partial<Context>): Context {
|
||||
function createContext(parentCtx: Context, params?: Partial<Context>) {
|
||||
return Object.assign(
|
||||
{
|
||||
block: null,
|
||||
@@ -214,14 +212,6 @@ class CodeTarget {
|
||||
result.push(`}`);
|
||||
return result.join("\n ");
|
||||
}
|
||||
|
||||
currentKey(ctx: Context) {
|
||||
let key = this.loopLevel ? `key${this.loopLevel}` : "key";
|
||||
if (ctx.tKeyExpr) {
|
||||
key = `${ctx.tKeyExpr} + ${key}`;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
const TRANSLATABLE_ATTRS = ["label", "title", "placeholder", "alt"];
|
||||
@@ -240,7 +230,6 @@ export class CodeGenerator {
|
||||
translatableAttributes: string[] = TRANSLATABLE_ATTRS;
|
||||
ast: AST;
|
||||
staticDefs: { id: string; expr: string }[] = [];
|
||||
slotNames: Set<String> = new Set();
|
||||
helpers: Set<string> = new Set();
|
||||
|
||||
constructor(ast: AST, options: CodeGenOptions) {
|
||||
@@ -276,7 +265,10 @@ export class CodeGenerator {
|
||||
tKeyExpr: null,
|
||||
});
|
||||
// define blocks and utility functions
|
||||
let mainCode = [` let { text, createBlock, list, multi, html, toggler, comment } = bdom;`];
|
||||
let mainCode = [
|
||||
` "use strict";`,
|
||||
`let { text, createBlock, list, multi, html, toggler, comment } = bdom;`,
|
||||
];
|
||||
if (this.helpers.size) {
|
||||
mainCode.push(`let { ${[...this.helpers].join(", ")} } = helpers;`);
|
||||
}
|
||||
@@ -345,8 +337,8 @@ export class CodeGenerator {
|
||||
this.addLine(`const ${varName} = ${expr};`);
|
||||
}
|
||||
|
||||
insertAnchor(block: BlockDescription, index: number = block.children.length) {
|
||||
const tag = `block-child-${index}`;
|
||||
insertAnchor(block: BlockDescription) {
|
||||
const tag = `block-child-${block.children.length}`;
|
||||
const anchor = xmlDoc.createElement(tag);
|
||||
block.insert(anchor);
|
||||
}
|
||||
@@ -373,15 +365,19 @@ export class CodeGenerator {
|
||||
|
||||
insertBlock(expression: string, block: BlockDescription, ctx: Context): void {
|
||||
let blockExpr = block.generateExpr(expression);
|
||||
const tKeyExpr = ctx.tKeyExpr;
|
||||
if (block.parentVar) {
|
||||
let key = this.target.currentKey(ctx);
|
||||
let keyArg = `key${this.target.loopLevel}`;
|
||||
if (tKeyExpr) {
|
||||
keyArg = `${tKeyExpr} + ${keyArg}`;
|
||||
}
|
||||
this.helpers.add("withKey");
|
||||
this.addLine(`${block.parentVar}[${ctx.index}] = withKey(${blockExpr}, ${key});`);
|
||||
this.addLine(`${block.parentVar}[${ctx.index}] = withKey(${blockExpr}, ${keyArg});`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx.tKeyExpr) {
|
||||
blockExpr = `toggler(${ctx.tKeyExpr}, ${blockExpr})`;
|
||||
if (tKeyExpr) {
|
||||
blockExpr = `toggler(${tKeyExpr}, ${blockExpr})`;
|
||||
}
|
||||
|
||||
if (block.isRoot && !ctx.preventRoot) {
|
||||
@@ -428,66 +424,78 @@ export class CodeGenerator {
|
||||
.join("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns the newly created block name, if any
|
||||
*/
|
||||
compileAST(ast: AST, ctx: Context): string | null {
|
||||
compileAST(ast: AST, ctx: Context) {
|
||||
switch (ast.type) {
|
||||
case ASTType.Comment:
|
||||
return this.compileComment(ast, ctx);
|
||||
this.compileComment(ast, ctx);
|
||||
break;
|
||||
case ASTType.Text:
|
||||
return this.compileText(ast, ctx);
|
||||
this.compileText(ast, ctx);
|
||||
break;
|
||||
case ASTType.DomNode:
|
||||
return this.compileTDomNode(ast, ctx);
|
||||
this.compileTDomNode(ast, ctx);
|
||||
break;
|
||||
case ASTType.TEsc:
|
||||
return this.compileTEsc(ast, ctx);
|
||||
this.compileTEsc(ast, ctx);
|
||||
break;
|
||||
case ASTType.TOut:
|
||||
return this.compileTOut(ast, ctx);
|
||||
this.compileTOut(ast, ctx);
|
||||
break;
|
||||
case ASTType.TIf:
|
||||
return this.compileTIf(ast, ctx);
|
||||
this.compileTIf(ast, ctx);
|
||||
break;
|
||||
case ASTType.TForEach:
|
||||
return this.compileTForeach(ast, ctx);
|
||||
this.compileTForeach(ast, ctx);
|
||||
break;
|
||||
case ASTType.TKey:
|
||||
return this.compileTKey(ast, ctx);
|
||||
this.compileTKey(ast, ctx);
|
||||
break;
|
||||
case ASTType.Multi:
|
||||
return this.compileMulti(ast, ctx);
|
||||
this.compileMulti(ast, ctx);
|
||||
break;
|
||||
case ASTType.TCall:
|
||||
return this.compileTCall(ast, ctx);
|
||||
this.compileTCall(ast, ctx);
|
||||
break;
|
||||
case ASTType.TCallBlock:
|
||||
return this.compileTCallBlock(ast, ctx);
|
||||
this.compileTCallBlock(ast, ctx);
|
||||
break;
|
||||
case ASTType.TSet:
|
||||
return this.compileTSet(ast, ctx);
|
||||
this.compileTSet(ast, ctx);
|
||||
break;
|
||||
case ASTType.TComponent:
|
||||
return this.compileComponent(ast, ctx);
|
||||
this.compileComponent(ast, ctx);
|
||||
break;
|
||||
case ASTType.TDebug:
|
||||
return this.compileDebug(ast, ctx);
|
||||
this.compileDebug(ast, ctx);
|
||||
break;
|
||||
case ASTType.TLog:
|
||||
return this.compileLog(ast, ctx);
|
||||
this.compileLog(ast, ctx);
|
||||
break;
|
||||
case ASTType.TSlot:
|
||||
return this.compileTSlot(ast, ctx);
|
||||
this.compileTSlot(ast, ctx);
|
||||
break;
|
||||
case ASTType.TTranslation:
|
||||
return this.compileTTranslation(ast, ctx);
|
||||
this.compileTTranslation(ast, ctx);
|
||||
break;
|
||||
case ASTType.TPortal:
|
||||
return this.compileTPortal(ast, ctx);
|
||||
this.compileTPortal(ast, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
compileDebug(ast: ASTDebug, ctx: Context): string | null {
|
||||
compileDebug(ast: ASTDebug, ctx: Context) {
|
||||
this.addLine(`debugger;`);
|
||||
if (ast.content) {
|
||||
return this.compileAST(ast.content, ctx);
|
||||
this.compileAST(ast.content, ctx);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
compileLog(ast: ASTLog, ctx: Context): string | null {
|
||||
compileLog(ast: ASTLog, ctx: Context) {
|
||||
this.addLine(`console.log(${compileExpr(ast.expr)});`);
|
||||
if (ast.content) {
|
||||
return this.compileAST(ast.content, ctx);
|
||||
this.compileAST(ast.content, ctx);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
compileComment(ast: ASTComment, ctx: Context): string {
|
||||
compileComment(ast: ASTComment, ctx: Context) {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
const isNewBlock = !block || forceNewBlock;
|
||||
if (isNewBlock) {
|
||||
@@ -500,10 +508,9 @@ export class CodeGenerator {
|
||||
const text = xmlDoc.createComment(ast.value);
|
||||
block!.insert(text);
|
||||
}
|
||||
return block!.varName;
|
||||
}
|
||||
|
||||
compileText(ast: ASTText, ctx: Context): string {
|
||||
compileText(ast: ASTText, ctx: Context) {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
|
||||
let value = ast.value;
|
||||
@@ -522,7 +529,6 @@ export class CodeGenerator {
|
||||
const createFn = ast.type === ASTType.Text ? xmlDoc.createTextNode : xmlDoc.createComment;
|
||||
block.insert(createFn.call(xmlDoc, value));
|
||||
}
|
||||
return block.varName;
|
||||
}
|
||||
|
||||
generateHandlerCode(rawEvent: string, handler: string): string {
|
||||
@@ -531,7 +537,7 @@ export class CodeGenerator {
|
||||
.slice(1)
|
||||
.map((m) => {
|
||||
if (!MODS.has(m)) {
|
||||
throw new OwlError(`Unknown event modifier: '${m}'`);
|
||||
throw new Error(`Unknown event modifier: '${m}'`);
|
||||
}
|
||||
return `"${m}"`;
|
||||
});
|
||||
@@ -542,7 +548,7 @@ export class CodeGenerator {
|
||||
return `[${modifiersCode}${this.captureExpression(handler)}, ctx]`;
|
||||
}
|
||||
|
||||
compileTDomNode(ast: ASTDomNode, ctx: Context): string {
|
||||
compileTDomNode(ast: ASTDomNode, ctx: Context) {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
const isNewBlock = !block || forceNewBlock || ast.dynamicTag !== null || ast.ns;
|
||||
let codeIdx = this.target.code.length;
|
||||
@@ -575,22 +581,13 @@ export class CodeGenerator {
|
||||
attrName = key.slice(7);
|
||||
attrs["block-attribute-" + idx] = attrName;
|
||||
} else if (key.startsWith("t-att")) {
|
||||
attrName = key === "t-att" ? null : key.slice(6);
|
||||
expr = compileExpr(ast.attrs[key]);
|
||||
if (attrName && isProp(ast.tag, attrName)) {
|
||||
// we force a new string or new boolean to bypass the equality check in blockdom when patching same value
|
||||
if (attrName === "value") {
|
||||
// When the expression is falsy, fall back to an empty string
|
||||
expr = `new String((${expr}) || "")`;
|
||||
} else {
|
||||
expr = `new Boolean(${expr})`;
|
||||
}
|
||||
}
|
||||
const idx = block!.insertData(expr, "attr");
|
||||
if (key === "t-att") {
|
||||
attrs[`block-attributes`] = String(idx);
|
||||
} else {
|
||||
attrs[`block-attribute-${idx}`] = attrName!;
|
||||
attrName = key.slice(6);
|
||||
attrs[`block-attribute-${idx}`] = attrName;
|
||||
}
|
||||
} else if (this.translatableAttributes.includes(key)) {
|
||||
attrs[key] = this.translateFn(ast.attrs[key]);
|
||||
@@ -698,7 +695,7 @@ export class CodeGenerator {
|
||||
const children = ast.content;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = ast.content[i];
|
||||
const subCtx = createContext(ctx, {
|
||||
const subCtx: Context = createContext(ctx, {
|
||||
block,
|
||||
index: block!.childNumber,
|
||||
forceNewBlock: false,
|
||||
@@ -729,10 +726,9 @@ export class CodeGenerator {
|
||||
this.addLine(`let ${block!.children.map((c) => c.varName)};`, codeIdx);
|
||||
}
|
||||
}
|
||||
return block!.varName;
|
||||
}
|
||||
|
||||
compileTEsc(ast: ASTTEsc, ctx: Context): string {
|
||||
compileTEsc(ast: ASTTEsc, ctx: Context) {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
let expr: string;
|
||||
if (ast.expr === "0") {
|
||||
@@ -753,47 +749,29 @@ export class CodeGenerator {
|
||||
const text = xmlDoc.createElement(`block-text-${idx}`);
|
||||
block.insert(text);
|
||||
}
|
||||
return block.varName;
|
||||
}
|
||||
|
||||
compileTOut(ast: ASTTOut, ctx: Context): string {
|
||||
compileTOut(ast: ASTTOut, ctx: Context) {
|
||||
let { block } = ctx;
|
||||
if (block) {
|
||||
this.insertAnchor(block);
|
||||
}
|
||||
block = this.createBlock(block, "html", ctx);
|
||||
let blockStr;
|
||||
if (ast.expr === "0") {
|
||||
this.helpers.add("zero");
|
||||
blockStr = `ctx[zero]`;
|
||||
} else if (ast.body) {
|
||||
let bodyValue = null;
|
||||
bodyValue = BlockDescription.nextBlockId;
|
||||
const subCtx = createContext(ctx);
|
||||
this.helpers.add(ast.expr === "0" ? "zero" : "safeOutput");
|
||||
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);
|
||||
this.helpers.add("safeOutput");
|
||||
blockStr = `safeOutput(${compileExpr(ast.expr)}, b${bodyValue})`;
|
||||
} else {
|
||||
this.helpers.add("safeOutput");
|
||||
blockStr = `safeOutput(${compileExpr(ast.expr)})`;
|
||||
this.helpers.add("withDefault");
|
||||
expr = `withDefault(${expr}, b${nextId})`;
|
||||
}
|
||||
this.insertBlock(blockStr, block, ctx);
|
||||
return block.varName;
|
||||
this.insertBlock(`${expr}`, block, ctx);
|
||||
}
|
||||
|
||||
compileTIfBranch(content: AST, block: BlockDescription, ctx: Context) {
|
||||
this.target.indentLevel++;
|
||||
let childN = block.children.length;
|
||||
this.compileAST(content, createContext(ctx, { block, index: ctx.index }));
|
||||
if (block.children.length > childN) {
|
||||
// we have some content => need to insert an anchor at correct index
|
||||
this.insertAnchor(block!, childN);
|
||||
}
|
||||
this.target.indentLevel--;
|
||||
}
|
||||
|
||||
compileTIf(ast: ASTTif, ctx: Context, nextNode?: ASTDomNode): string {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
compileTIf(ast: ASTTif, ctx: Context, nextNode?: ASTDomNode) {
|
||||
let { block, forceNewBlock, index } = ctx;
|
||||
let currentIndex = index;
|
||||
const codeIdx = this.target.code.length;
|
||||
const isNewBlock = !block || (block.type !== "multi" && forceNewBlock);
|
||||
if (block) {
|
||||
@@ -803,16 +781,28 @@ export class CodeGenerator {
|
||||
block = this.createBlock(block, "multi", ctx);
|
||||
}
|
||||
this.addLine(`if (${compileExpr(ast.condition)}) {`);
|
||||
this.compileTIfBranch(ast.content, block, ctx);
|
||||
this.target.indentLevel++;
|
||||
this.insertAnchor(block!);
|
||||
const subCtx: Context = createContext(ctx, { block, index: currentIndex });
|
||||
this.compileAST(ast.content, subCtx);
|
||||
this.target.indentLevel--;
|
||||
if (ast.tElif) {
|
||||
for (let clause of ast.tElif) {
|
||||
this.addLine(`} else if (${compileExpr(clause.condition)}) {`);
|
||||
this.compileTIfBranch(clause.content, block, ctx);
|
||||
this.target.indentLevel++;
|
||||
this.insertAnchor(block);
|
||||
const subCtx: Context = createContext(ctx, { block, index: currentIndex });
|
||||
this.compileAST(clause.content, subCtx);
|
||||
this.target.indentLevel--;
|
||||
}
|
||||
}
|
||||
if (ast.tElse) {
|
||||
this.addLine(`} else {`);
|
||||
this.compileTIfBranch(ast.tElse, block, ctx);
|
||||
this.target.indentLevel++;
|
||||
this.insertAnchor(block);
|
||||
const subCtx: Context = createContext(ctx, { block, index: currentIndex });
|
||||
this.compileAST(ast.tElse, subCtx);
|
||||
this.target.indentLevel--;
|
||||
}
|
||||
this.addLine("}");
|
||||
if (isNewBlock) {
|
||||
@@ -835,10 +825,9 @@ export class CodeGenerator {
|
||||
const args = block!.children.map((c) => c.varName).join(", ");
|
||||
this.insertBlock(`multi([${args}])`, block!, ctx)!;
|
||||
}
|
||||
return block.varName;
|
||||
}
|
||||
|
||||
compileTForeach(ast: ASTTForEach, ctx: Context): string {
|
||||
compileTForeach(ast: ASTTForEach, ctx: Context) {
|
||||
let { block } = ctx;
|
||||
if (block) {
|
||||
this.insertAnchor(block);
|
||||
@@ -875,11 +864,10 @@ export class CodeGenerator {
|
||||
this.define(`key${this.target.loopLevel}`, ast.key ? compileExpr(ast.key) : loopVar);
|
||||
if (this.dev) {
|
||||
// Throw error on duplicate keys in dev mode
|
||||
this.helpers.add("OwlError");
|
||||
this.addLine(
|
||||
`if (keys${block.id}.has(String(key${this.target.loopLevel}))) { throw new OwlError(\`Got duplicate key in t-foreach: \${key${this.target.loopLevel}}\`)}`
|
||||
`if (keys${block.id}.has(key${this.target.loopLevel})) { throw new Error(\`Got duplicate key in t-foreach: \${key${this.target.loopLevel}}\`)}`
|
||||
);
|
||||
this.addLine(`keys${block.id}.add(String(key${this.target.loopLevel}));`);
|
||||
this.addLine(`keys${block.id}.add(key${this.target.loopLevel});`);
|
||||
}
|
||||
let id: string;
|
||||
if (ast.memo) {
|
||||
@@ -900,7 +888,7 @@ export class CodeGenerator {
|
||||
this.addLine("}");
|
||||
}
|
||||
|
||||
const subCtx = createContext(ctx, { block, index: loopVar });
|
||||
const subCtx: Context = createContext(ctx, { block, index: loopVar });
|
||||
this.compileAST(ast.body, subCtx);
|
||||
if (ast.memo) {
|
||||
this.addLine(
|
||||
@@ -916,10 +904,9 @@ export class CodeGenerator {
|
||||
this.addLine(`ctx = ctx.__proto__;`);
|
||||
}
|
||||
this.insertBlock("l", block, ctx);
|
||||
return block.varName;
|
||||
}
|
||||
|
||||
compileTKey(ast: ASTTKey, ctx: Context): string | null {
|
||||
compileTKey(ast: ASTTKey, ctx: Context) {
|
||||
const tKeyExpr = generateId("tKey_");
|
||||
this.define(tKeyExpr, compileExpr(ast.expr));
|
||||
ctx = createContext(ctx, {
|
||||
@@ -927,22 +914,20 @@ export class CodeGenerator {
|
||||
block: ctx.block,
|
||||
index: ctx.index,
|
||||
});
|
||||
return this.compileAST(ast.content, ctx);
|
||||
this.compileAST(ast.content, ctx);
|
||||
}
|
||||
|
||||
compileMulti(ast: ASTMulti, ctx: Context): string | null {
|
||||
compileMulti(ast: ASTMulti, ctx: Context) {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
const isNewBlock = !block || forceNewBlock;
|
||||
let codeIdx = this.target.code.length;
|
||||
if (isNewBlock) {
|
||||
const n = ast.content.filter((c) => c.type !== ASTType.TSet).length;
|
||||
let result: string | null = null;
|
||||
if (n <= 1) {
|
||||
for (let child of ast.content) {
|
||||
const blockName = this.compileAST(child, ctx);
|
||||
result = result || blockName;
|
||||
this.compileAST(child, ctx);
|
||||
}
|
||||
return result;
|
||||
return;
|
||||
}
|
||||
block = this.createBlock(block, "multi", ctx);
|
||||
}
|
||||
@@ -950,7 +935,7 @@ export class CodeGenerator {
|
||||
for (let i = 0, l = ast.content.length; i < l; i++) {
|
||||
const child = ast.content[i];
|
||||
const isTSet = child.type === ASTType.TSet;
|
||||
const subCtx = createContext(ctx, {
|
||||
const subCtx: Context = createContext(ctx, {
|
||||
block,
|
||||
index,
|
||||
forceNewBlock: !isTSet,
|
||||
@@ -982,10 +967,9 @@ export class CodeGenerator {
|
||||
const args = block!.children.map((c) => c.varName).join(", ");
|
||||
this.insertBlock(`multi([${args}])`, block!, ctx)!;
|
||||
}
|
||||
return block!.varName;
|
||||
}
|
||||
|
||||
compileTCall(ast: ASTTCall, ctx: Context): string {
|
||||
compileTCall(ast: ASTTCall, ctx: Context) {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
let ctxVar = ctx.ctxVar || "ctx";
|
||||
if (ast.context) {
|
||||
@@ -996,11 +980,12 @@ export class CodeGenerator {
|
||||
this.addLine(`${ctxVar} = Object.create(${ctxVar});`);
|
||||
this.addLine(`${ctxVar}[isBoundary] = 1;`);
|
||||
this.helpers.add("isBoundary");
|
||||
const subCtx = createContext(ctx, { preventRoot: true, ctxVar });
|
||||
const bl = this.compileMulti({ type: ASTType.Multi, content: ast.body }, subCtx);
|
||||
if (bl) {
|
||||
const nextId = BlockDescription.nextBlockId;
|
||||
const subCtx: Context = createContext(ctx, { preventRoot: true, ctxVar });
|
||||
this.compileAST({ type: ASTType.Multi, content: ast.body }, subCtx);
|
||||
if (nextId !== BlockDescription.nextBlockId) {
|
||||
this.helpers.add("zero");
|
||||
this.addLine(`${ctxVar}[zero] = ${bl};`);
|
||||
this.addLine(`${ctxVar}[zero] = b${nextId};`);
|
||||
}
|
||||
}
|
||||
const isDynamic = INTERP_REGEXP.test(ast.name);
|
||||
@@ -1034,10 +1019,9 @@ export class CodeGenerator {
|
||||
if (ast.body && !ctx.isLast) {
|
||||
this.addLine(`${ctxVar} = ${ctxVar}.__proto__;`);
|
||||
}
|
||||
return block.varName;
|
||||
}
|
||||
|
||||
compileTCallBlock(ast: ASTTCallBlock, ctx: Context): string {
|
||||
compileTCallBlock(ast: ASTTCallBlock, ctx: Context) {
|
||||
let { block, forceNewBlock } = ctx;
|
||||
if (block) {
|
||||
if (!forceNewBlock) {
|
||||
@@ -1046,10 +1030,9 @@ export class CodeGenerator {
|
||||
}
|
||||
block = this.createBlock(block, "multi", ctx);
|
||||
this.insertBlock(compileExpr(ast.name), block, { ...ctx, forceNewBlock: !block });
|
||||
return block.varName;
|
||||
}
|
||||
|
||||
compileTSet(ast: ASTTSet, ctx: Context): null {
|
||||
compileTSet(ast: ASTTSet, ctx: Context) {
|
||||
this.target.shouldProtectScope = true;
|
||||
this.helpers.add("isBoundary").add("withDefault");
|
||||
const expr = ast.value ? compileExpr(ast.value || "") : "null";
|
||||
@@ -1057,8 +1040,7 @@ export class CodeGenerator {
|
||||
this.helpers.add("LazyValue");
|
||||
const bodyAst: AST = { type: ASTType.Multi, content: ast.body };
|
||||
const name = this.compileInNewTarget("value", bodyAst, ctx);
|
||||
let key = this.target.currentKey(ctx);
|
||||
let value = `new LazyValue(${name}, ctx, this, node, ${key})`;
|
||||
let value = `new LazyValue(${name}, ctx, this, node)`;
|
||||
value = ast.value ? (value ? `withDefault(${expr}, ${value})` : expr) : value;
|
||||
this.addLine(`ctx[\`${ast.name}\`] = ${value};`);
|
||||
} else {
|
||||
@@ -1075,7 +1057,6 @@ export class CodeGenerator {
|
||||
this.helpers.add("setContextValue");
|
||||
this.addLine(`setContextValue(${ctx.ctxVar || "ctx"}, "${ast.name}", ${value});`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
generateComponentKey() {
|
||||
@@ -1106,7 +1087,7 @@ export class CodeGenerator {
|
||||
name = _name;
|
||||
value = `bind(ctx, ${value || undefined})`;
|
||||
} else {
|
||||
throw new OwlError("Invalid prop suffix");
|
||||
throw new Error("Invalid prop suffix");
|
||||
}
|
||||
}
|
||||
name = /^[a-z_]+$/i.test(name) ? name : `'${name}'`;
|
||||
@@ -1127,7 +1108,7 @@ export class CodeGenerator {
|
||||
return propString;
|
||||
}
|
||||
|
||||
compileComponent(ast: ASTComponent, ctx: Context): string {
|
||||
compileComponent(ast: ASTComponent, ctx: Context) {
|
||||
let { block } = ctx;
|
||||
// props
|
||||
const hasSlotsProp = "slots" in (ast.props || {});
|
||||
@@ -1193,7 +1174,7 @@ export class CodeGenerator {
|
||||
}
|
||||
|
||||
if (this.dev) {
|
||||
this.addLine(`helpers.validateProps(${expr}, ${propVar!}, this);`);
|
||||
this.addLine(`helpers.validateProps(${expr}, ${propVar!}, ctx);`);
|
||||
}
|
||||
|
||||
if (block && (ctx.forceNewBlock === false || ctx.tKeyExpr)) {
|
||||
@@ -1227,7 +1208,6 @@ export class CodeGenerator {
|
||||
|
||||
block = this.createBlock(block, "multi", ctx);
|
||||
this.insertBlock(blockExpr, block, ctx);
|
||||
return block.varName;
|
||||
}
|
||||
|
||||
wrapWithEventCatcher(expr: string, on: EventHandlers): string {
|
||||
@@ -1246,43 +1226,34 @@ export class CodeGenerator {
|
||||
return `${name}(${expr}, [${handlers.join(",")}])`;
|
||||
}
|
||||
|
||||
compileTSlot(ast: ASTSlot, ctx: Context): string {
|
||||
compileTSlot(ast: ASTSlot, ctx: Context) {
|
||||
this.helpers.add("callSlot");
|
||||
let { block } = ctx;
|
||||
let blockString: string;
|
||||
let slotName;
|
||||
let dynamic = false;
|
||||
let isMultiple = false;
|
||||
if (ast.name.match(INTERP_REGEXP)) {
|
||||
dynamic = true;
|
||||
isMultiple = true;
|
||||
slotName = interpolate(ast.name);
|
||||
} else {
|
||||
slotName = "'" + ast.name + "'";
|
||||
isMultiple = isMultiple || this.slotNames.has(ast.name);
|
||||
this.slotNames.add(ast.name);
|
||||
}
|
||||
const dynProps = ast.attrs ? ast.attrs["t-props"] : null;
|
||||
if (ast.attrs) {
|
||||
delete ast.attrs["t-props"];
|
||||
}
|
||||
let key = this.target.loopLevel ? `key${this.target.loopLevel}` : "key";
|
||||
if (isMultiple) {
|
||||
key = `${key} + \`${this.generateComponentKey()}\``;
|
||||
}
|
||||
|
||||
const props = ast.attrs ? this.formatPropObject(ast.attrs) : [];
|
||||
const scope = this.getPropString(props, dynProps);
|
||||
if (ast.defaultContent) {
|
||||
const name = this.compileInNewTarget("defaultContent", ast.defaultContent, ctx);
|
||||
blockString = `callSlot(ctx, node, ${key}, ${slotName}, ${dynamic}, ${scope}, ${name})`;
|
||||
blockString = `callSlot(ctx, node, key, ${slotName}, ${dynamic}, ${scope}, ${name})`;
|
||||
} else {
|
||||
if (dynamic) {
|
||||
let name = generateId("slot");
|
||||
this.define(name, slotName);
|
||||
blockString = `toggler(${name}, callSlot(ctx, node, ${key}, ${name}, ${dynamic}, ${scope}))`;
|
||||
blockString = `toggler(${name}, callSlot(ctx, node, key, ${name}, ${dynamic}, ${scope}))`;
|
||||
} else {
|
||||
blockString = `callSlot(ctx, node, ${key}, ${slotName}, ${dynamic}, ${scope})`;
|
||||
blockString = `callSlot(ctx, node, key, ${slotName}, ${dynamic}, ${scope})`;
|
||||
}
|
||||
}
|
||||
// event handling
|
||||
@@ -1295,16 +1266,14 @@ export class CodeGenerator {
|
||||
}
|
||||
block = this.createBlock(block, "multi", ctx);
|
||||
this.insertBlock(blockString, block, { ...ctx, forceNewBlock: false });
|
||||
return block.varName;
|
||||
}
|
||||
|
||||
compileTTranslation(ast: ASTTranslation, ctx: Context): string | null {
|
||||
compileTTranslation(ast: ASTTranslation, ctx: Context) {
|
||||
if (ast.content) {
|
||||
return this.compileAST(ast.content, Object.assign({}, ctx, { translate: false }));
|
||||
this.compileAST(ast.content, Object.assign({}, ctx, { translate: false }));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
compileTPortal(ast: ASTTPortal, ctx: Context): string {
|
||||
compileTPortal(ast: ASTTPortal, ctx: Context) {
|
||||
if (!this.staticDefs.find((d) => d.id === "Portal")) {
|
||||
this.staticDefs.push({ id: "Portal", expr: `app.Portal` });
|
||||
}
|
||||
@@ -1331,6 +1300,5 @@ export class CodeGenerator {
|
||||
}
|
||||
block = this.createBlock(block, "multi", ctx);
|
||||
this.insertBlock(blockString, block, { ...ctx, forceNewBlock: false });
|
||||
return block.varName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { OwlError } from "../runtime/error_handling";
|
||||
|
||||
/**
|
||||
* Owl QWeb Expression Parser
|
||||
*
|
||||
@@ -108,14 +106,14 @@ let tokenizeString: Tokenizer = function (expr) {
|
||||
i++;
|
||||
cur = expr[i];
|
||||
if (!cur) {
|
||||
throw new OwlError("Invalid expression");
|
||||
throw new Error("Invalid expression");
|
||||
}
|
||||
s += cur;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (expr[i] !== start) {
|
||||
throw new OwlError("Invalid expression");
|
||||
throw new Error("Invalid expression");
|
||||
}
|
||||
s += start;
|
||||
if (start === "`") {
|
||||
@@ -225,7 +223,7 @@ export function tokenize(expr: string): Token[] {
|
||||
error = e; // Silence all errors and throw a generic error below
|
||||
}
|
||||
if (current.length || error) {
|
||||
throw new OwlError(`Tokenizer error: could not tokenize \`${expr}\``);
|
||||
throw new Error(`Tokenizer error: could not tokenize \`${expr}\``);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+19
-26
@@ -1,5 +1,3 @@
|
||||
import { OwlError } from "../runtime/error_handling";
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// AST Type definition
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -321,7 +319,7 @@ function parseDOMNode(node: Element, ctx: ParsingContext): AST | null {
|
||||
return null;
|
||||
}
|
||||
if (tagName.startsWith("block-")) {
|
||||
throw new OwlError(`Invalid tag name: '${tagName}'`);
|
||||
throw new Error(`Invalid tag name: '${tagName}'`);
|
||||
}
|
||||
ctx = Object.assign({}, ctx);
|
||||
if (tagName === "pre") {
|
||||
@@ -342,15 +340,13 @@ function parseDOMNode(node: Element, ctx: ParsingContext): AST | null {
|
||||
const value = node.getAttribute(attr)!;
|
||||
if (attr.startsWith("t-on")) {
|
||||
if (attr === "t-on") {
|
||||
throw new OwlError("Missing event name with t-on directive");
|
||||
throw new Error("Missing event name with t-on directive");
|
||||
}
|
||||
on = on || {};
|
||||
on[attr.slice(5)] = value;
|
||||
} else if (attr.startsWith("t-model")) {
|
||||
if (!["input", "select", "textarea"].includes(tagName)) {
|
||||
throw new OwlError(
|
||||
"The t-model directive only works with <input>, <textarea> and <select>"
|
||||
);
|
||||
throw new Error("The t-model directive only works with <input>, <textarea> and <select>");
|
||||
}
|
||||
|
||||
let baseExpr, expr;
|
||||
@@ -363,7 +359,7 @@ function parseDOMNode(node: Element, ctx: ParsingContext): AST | null {
|
||||
baseExpr = value.slice(0, index);
|
||||
expr = value.slice(index + 1, -1);
|
||||
} else {
|
||||
throw new OwlError(`Invalid t-model expression: "${value}" (it should be assignable)`);
|
||||
throw new Error(`Invalid t-model expression: "${value}" (it should be assignable)`);
|
||||
}
|
||||
|
||||
const typeAttr = node.getAttribute("type");
|
||||
@@ -394,10 +390,10 @@ function parseDOMNode(node: Element, ctx: ParsingContext): AST | null {
|
||||
ctx.tModelInfo = model;
|
||||
}
|
||||
} else if (attr.startsWith("block-")) {
|
||||
throw new OwlError(`Invalid attribute: '${attr}'`);
|
||||
throw new Error(`Invalid attribute: '${attr}'`);
|
||||
} else if (attr !== "t-name") {
|
||||
if (attr.startsWith("t-") && !attr.startsWith("t-att")) {
|
||||
throw new OwlError(`Unknown QWeb directive: '${attr}'`);
|
||||
throw new Error(`Unknown QWeb directive: '${attr}'`);
|
||||
}
|
||||
const tModel = ctx.tModelInfo;
|
||||
if (tModel && ["t-att-value", "t-attf-value"].includes(attr)) {
|
||||
@@ -451,7 +447,7 @@ function parseTEscNode(node: Element, ctx: ParsingContext): AST | null {
|
||||
};
|
||||
}
|
||||
if (ast.type === ASTType.TComponent) {
|
||||
throw new OwlError("t-esc is not supported on Component nodes");
|
||||
throw new Error("t-esc is not supported on Component nodes");
|
||||
}
|
||||
return tesc;
|
||||
}
|
||||
@@ -507,7 +503,7 @@ function parseTForEach(node: Element, ctx: ParsingContext): AST | null {
|
||||
node.removeAttribute("t-as");
|
||||
const key = node.getAttribute("t-key");
|
||||
if (!key) {
|
||||
throw new OwlError(
|
||||
throw new Error(
|
||||
`"Directive t-foreach should always be used with a t-key!" (expression: t-foreach="${collection}" t-as="${elem}")`
|
||||
);
|
||||
}
|
||||
@@ -690,9 +686,7 @@ function parseComponent(node: Element, ctx: ParsingContext): AST | null {
|
||||
let isDynamic = node.hasAttribute("t-component");
|
||||
|
||||
if (isDynamic && name !== "t") {
|
||||
throw new OwlError(
|
||||
`Directive 't-component' can only be used on <t> nodes (used on a <${name}>)`
|
||||
);
|
||||
throw new Error(`Directive 't-component' can only be used on <t> nodes (used on a <${name}>)`);
|
||||
}
|
||||
|
||||
if (!(firstLetter === firstLetter.toUpperCase() || isDynamic)) {
|
||||
@@ -719,7 +713,7 @@ function parseComponent(node: Element, ctx: ParsingContext): AST | null {
|
||||
on[name.slice(5)] = value;
|
||||
} else {
|
||||
const message = directiveErrorMap.get(name.split("-").slice(0, 2).join("-"));
|
||||
throw new OwlError(message || `unsupported directive on Component: ${name}`);
|
||||
throw new Error(message || `unsupported directive on Component: ${name}`);
|
||||
}
|
||||
} else {
|
||||
props = props || {};
|
||||
@@ -735,7 +729,7 @@ function parseComponent(node: Element, ctx: ParsingContext): AST | null {
|
||||
const slotNodes = Array.from(clone.querySelectorAll("[t-set-slot]"));
|
||||
for (let slotNode of slotNodes) {
|
||||
if (slotNode.tagName !== "t") {
|
||||
throw new OwlError(
|
||||
throw new Error(
|
||||
`Directive 't-set-slot' can only be used on <t> nodes (used on a <${slotNode.tagName}>)`
|
||||
);
|
||||
}
|
||||
@@ -781,9 +775,8 @@ function parseComponent(node: Element, ctx: ParsingContext): AST | null {
|
||||
|
||||
// default slot
|
||||
const defaultContent = parseChildNodes(clone, ctx);
|
||||
slots = slots || {};
|
||||
// t-set-slot="default" has priority over content
|
||||
if (defaultContent && !slots.default) {
|
||||
if (defaultContent) {
|
||||
slots = slots || {};
|
||||
slots.default = { content: defaultContent, on, attrs: null, scope: defaultSlotScope };
|
||||
}
|
||||
}
|
||||
@@ -911,7 +904,7 @@ function normalizeTIf(el: Element) {
|
||||
let nattr = (name: string) => +!!node.getAttribute(name);
|
||||
if (prevElem && (pattr("t-if") || pattr("t-elif"))) {
|
||||
if (pattr("t-foreach")) {
|
||||
throw new OwlError(
|
||||
throw new Error(
|
||||
"t-if cannot stay at the same level as t-foreach when using t-elif or t-else"
|
||||
);
|
||||
}
|
||||
@@ -920,19 +913,19 @@ function normalizeTIf(el: Element) {
|
||||
return a + b;
|
||||
}) > 1
|
||||
) {
|
||||
throw new OwlError("Only one conditional branching directive is allowed per node");
|
||||
throw new Error("Only one conditional branching directive is allowed per node");
|
||||
}
|
||||
// All text (with only spaces) and comment nodes (nodeType 8) between
|
||||
// branch nodes are removed
|
||||
let textNode;
|
||||
while ((textNode = node.previousSibling) !== prevElem) {
|
||||
if (textNode!.nodeValue!.trim().length && textNode!.nodeType !== 8) {
|
||||
throw new OwlError("text is not allowed between branching directives");
|
||||
throw new Error("text is not allowed between branching directives");
|
||||
}
|
||||
textNode!.remove();
|
||||
}
|
||||
} else {
|
||||
throw new OwlError(
|
||||
throw new Error(
|
||||
"t-elif and t-else directives must be preceded by a t-if or t-elif directive"
|
||||
);
|
||||
}
|
||||
@@ -953,7 +946,7 @@ function normalizeTEsc(el: Element) {
|
||||
);
|
||||
for (const el of elements) {
|
||||
if (el.childNodes.length) {
|
||||
throw new OwlError("Cannot have t-esc on a component that already has content");
|
||||
throw new Error("Cannot have t-esc on a component that already has content");
|
||||
}
|
||||
const value = el.getAttribute("t-esc");
|
||||
el.removeAttribute("t-esc");
|
||||
@@ -1007,7 +1000,7 @@ function parseXML(xml: string): XMLDocument {
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new OwlError(msg);
|
||||
throw new Error(msg);
|
||||
}
|
||||
|
||||
return doc;
|
||||
|
||||
+11
-10
@@ -1,12 +1,12 @@
|
||||
import { Component, ComponentConstructor, Props } from "./component";
|
||||
import { ComponentNode } from "./component_node";
|
||||
import { nodeErrorHandlers, OwlError } from "./error_handling";
|
||||
import { nodeErrorHandlers } from "./error_handling";
|
||||
import { Fiber, MountOptions } from "./fibers";
|
||||
import { Scheduler } from "./scheduler";
|
||||
import { STATUS } from "./status";
|
||||
import { validateProps } from "./template_helpers";
|
||||
import { TemplateSet, TemplateSetConfig } from "./template_set";
|
||||
import { validateTarget } from "./utils";
|
||||
import { handleError } from "./error_handling";
|
||||
|
||||
// reimplement dev mode stuff see last change in 0f7a8289a6fb8387c3c1af41c6664b2a8448758f
|
||||
|
||||
@@ -95,7 +95,9 @@ export class App<
|
||||
nodeErrorHandlers.set(node, handlers);
|
||||
}
|
||||
handlers.unshift((e) => {
|
||||
if (!isResolved) {
|
||||
if (isResolved) {
|
||||
console.error(e);
|
||||
} else {
|
||||
reject(e);
|
||||
}
|
||||
throw e;
|
||||
@@ -139,7 +141,10 @@ export class App<
|
||||
return (props: P, key: string, ctx: ComponentNode, parent: any, C: any) => {
|
||||
let children = ctx.children;
|
||||
let node: any = children[key];
|
||||
if (isDynamic && node && node.component.constructor !== C) {
|
||||
if (
|
||||
node &&
|
||||
(node.status === STATUS.DESTROYED || (isDynamic && node.component.constructor !== C))
|
||||
) {
|
||||
node = undefined;
|
||||
}
|
||||
const parentFiber = ctx.fiber!;
|
||||
@@ -153,9 +158,9 @@ export class App<
|
||||
if (isStatic) {
|
||||
C = parent.constructor.components[name as any];
|
||||
if (!C) {
|
||||
throw new OwlError(`Cannot find the definition of component "${name}"`);
|
||||
throw new Error(`Cannot find the definition of component "${name}"`);
|
||||
} else if (!(C.prototype instanceof Component)) {
|
||||
throw new OwlError(
|
||||
throw new Error(
|
||||
`"${name}" is not a Component. It must inherit from the Component class`
|
||||
);
|
||||
}
|
||||
@@ -168,10 +173,6 @@ export class App<
|
||||
return node;
|
||||
};
|
||||
}
|
||||
|
||||
handleError(...args: Parameters<typeof handleError>) {
|
||||
return handleError(...args);
|
||||
}
|
||||
}
|
||||
|
||||
export async function mount<
|
||||
|
||||
@@ -144,7 +144,7 @@ export function updateClass(this: HTMLElement, val: any, oldVal: any) {
|
||||
export function makePropSetter(name: string): Setter<HTMLElement> {
|
||||
return function setProp(this: HTMLElement, value: any) {
|
||||
// support 0, fallback to empty string for other falsy values
|
||||
(this as any)[name] = value === 0 ? 0 : value ? value.valueOf() : "";
|
||||
(this as any)[name] = value === 0 ? 0 : value || "";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { OwlError } from "../error_handling";
|
||||
import {
|
||||
attrsSetter,
|
||||
attrsUpdater,
|
||||
@@ -157,15 +156,6 @@ function buildTree(
|
||||
: document.createElement(tagName);
|
||||
}
|
||||
if (el instanceof Element) {
|
||||
if (!domParentTree) {
|
||||
// some html elements may have side effects when setting their attributes.
|
||||
// For example, setting the src attribute of an <img/> will trigger a
|
||||
// request to get the corresponding image. This is something that we
|
||||
// don't want at compile time. We avoid that by putting the content of
|
||||
// the block in a <template/> element
|
||||
const fragment = document.createElement("template").content;
|
||||
fragment.appendChild(el);
|
||||
}
|
||||
for (let i = 0; i < attrs.length; i++) {
|
||||
const attrName = attrs[i].name;
|
||||
const attrValue = attrs[i].value;
|
||||
@@ -255,7 +245,7 @@ function buildTree(
|
||||
};
|
||||
}
|
||||
}
|
||||
throw new OwlError("boom");
|
||||
throw new Error("boom");
|
||||
}
|
||||
|
||||
function addRef(tree: IntermediateTree) {
|
||||
@@ -517,13 +507,9 @@ function createBlockClass(template: HTMLElement, ctx: BlockCtx): BlockClass {
|
||||
return this.el!;
|
||||
}
|
||||
|
||||
moveBeforeDOMNode(node: Node | null, parent = this.parentEl) {
|
||||
this.parentEl = parent;
|
||||
nodeInsertBefore.call(parent, this.el!, node);
|
||||
}
|
||||
|
||||
moveBeforeVNode(other: Block | null, afterNode: Node | null) {
|
||||
nodeInsertBefore.call(this.parentEl, this.el!, other ? other.el! : afterNode);
|
||||
moveBefore(other: Block | null, afterNode: Node | null) {
|
||||
const target = other ? other.el! : afterNode;
|
||||
nodeInsertBefore.call(this.parentEl, this.el!, target);
|
||||
}
|
||||
|
||||
toString() {
|
||||
|
||||
@@ -46,7 +46,7 @@ export function createCatcher(eventsSpec: EventsSpec): Catcher {
|
||||
const target = ev.target;
|
||||
let currentNode: any = self.child.firstNode();
|
||||
const afterNode = self.afterNode;
|
||||
while (currentNode && currentNode !== afterNode) {
|
||||
while (currentNode !== afterNode) {
|
||||
if (currentNode.contains(target)) {
|
||||
return origFn.call(this, ev);
|
||||
}
|
||||
@@ -56,18 +56,8 @@ export function createCatcher(eventsSpec: EventsSpec): Catcher {
|
||||
}
|
||||
}
|
||||
|
||||
moveBeforeDOMNode(node: Node | null, parent = this.parentEl) {
|
||||
this.parentEl = parent;
|
||||
this.child.moveBeforeDOMNode(node, parent);
|
||||
parent!.insertBefore(this.afterNode!, node);
|
||||
}
|
||||
|
||||
moveBeforeVNode(other: VCatcher | null, afterNode: Node | null) {
|
||||
if (other) {
|
||||
// check this with @ged-odoo for use in foreach
|
||||
afterNode = other.firstNode() || afterNode;
|
||||
}
|
||||
this.child.moveBeforeVNode(other ? other.child : null, afterNode);
|
||||
moveBefore(other: VCatcher | null, afterNode: Node | null) {
|
||||
this.child.moveBefore(other ? other.child : null, afterNode);
|
||||
this.parentEl!.insertBefore(this.afterNode!, afterNode);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ function createElementHandler(evName: string, capture: boolean = false): EventHa
|
||||
}
|
||||
|
||||
function listener(ev: Event) {
|
||||
const currentTarget = ev.currentTarget as HTMLElement;
|
||||
if (!currentTarget || !currentTarget.ownerDocument.contains(currentTarget)) return;
|
||||
const currentTarget = ev.currentTarget;
|
||||
if (!currentTarget || !document.contains(currentTarget as HTMLElement)) return;
|
||||
const data = (currentTarget as any)[eventKey];
|
||||
if (!data) return;
|
||||
config.mainEventHandler(data, ev, currentTarget);
|
||||
|
||||
@@ -29,16 +29,12 @@ class VHtml {
|
||||
}
|
||||
}
|
||||
|
||||
moveBeforeDOMNode(node: Node | null, parent = this.parentEl) {
|
||||
this.parentEl = parent;
|
||||
for (let elem of this.content) {
|
||||
nodeInsertBefore.call(parent, elem, node);
|
||||
}
|
||||
}
|
||||
|
||||
moveBeforeVNode(other: VHtml | null, afterNode: Node | null) {
|
||||
moveBefore(other: VHtml | null, afterNode: Node | null) {
|
||||
const target = other ? other.content[0] : afterNode;
|
||||
this.moveBeforeDOMNode(target);
|
||||
const parent = this.parentEl;
|
||||
for (let elem of this.content) {
|
||||
nodeInsertBefore.call(parent, elem, target);
|
||||
}
|
||||
}
|
||||
|
||||
patch(other: VHtml) {
|
||||
|
||||
@@ -10,8 +10,7 @@ export { createCatcher } from "./event_catcher";
|
||||
|
||||
export interface VNode<T = any> {
|
||||
mount(parent: HTMLElement, afterNode: Node | null): void;
|
||||
moveBeforeDOMNode(node: Node | null, parent?: HTMLElement): void;
|
||||
moveBeforeVNode(other: T | null, afterNode: Node | null): void;
|
||||
moveBefore(other: T | null, afterNode: Node | null): void;
|
||||
patch(other: T, withBeforeRemove: boolean): void;
|
||||
beforeRemove(): void;
|
||||
remove(): void;
|
||||
|
||||
@@ -38,23 +38,14 @@ class VList {
|
||||
this.parentEl = parent;
|
||||
}
|
||||
|
||||
moveBeforeDOMNode(node: Node | null, parent = this.parentEl) {
|
||||
this.parentEl = parent;
|
||||
const children = this.children;
|
||||
for (let i = 0, l = children.length; i < l; i++) {
|
||||
children[i].moveBeforeDOMNode(node, parent);
|
||||
}
|
||||
parent!.insertBefore(this.anchor!, node);
|
||||
}
|
||||
|
||||
moveBeforeVNode(other: VList | null, afterNode: Node | null) {
|
||||
moveBefore(other: VList | null, afterNode: Node | null) {
|
||||
if (other) {
|
||||
const next = other!.children[0];
|
||||
afterNode = (next ? next.firstNode() : other!.anchor) || null;
|
||||
}
|
||||
const children = this.children;
|
||||
for (let i = 0, l = children.length; i < l; i++) {
|
||||
children[i].moveBeforeVNode(null, afterNode);
|
||||
children[i].moveBefore(null, afterNode);
|
||||
}
|
||||
this.parentEl!.insertBefore(this.anchor!, afterNode);
|
||||
}
|
||||
@@ -75,7 +66,7 @@ class VList {
|
||||
patch: cPatch,
|
||||
remove: cRemove,
|
||||
beforeRemove,
|
||||
moveBeforeVNode: cMoveBefore,
|
||||
moveBefore: cMoveBefore,
|
||||
firstNode: cFirstNode,
|
||||
} = proto;
|
||||
|
||||
|
||||
@@ -38,22 +38,7 @@ export class VMulti {
|
||||
this.parentEl = parent;
|
||||
}
|
||||
|
||||
moveBeforeDOMNode(node: Node | null, parent = this.parentEl) {
|
||||
this.parentEl = parent;
|
||||
const children = this.children;
|
||||
const anchors = this.anchors;
|
||||
for (let i = 0, l = children.length; i < l; i++) {
|
||||
let child = children[i];
|
||||
if (child) {
|
||||
child.moveBeforeDOMNode(node, parent);
|
||||
} else {
|
||||
const anchor = anchors![i];
|
||||
nodeInsertBefore.call(parent, anchor, node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
moveBeforeVNode(other: VMulti | null, afterNode: Node | null) {
|
||||
moveBefore(other: VMulti | null, afterNode: Node | null) {
|
||||
if (other) {
|
||||
const next = other!.children[0];
|
||||
afterNode = (next ? next.firstNode() : other!.anchors![0]) || null;
|
||||
@@ -64,7 +49,7 @@ export class VMulti {
|
||||
for (let i = 0, l = children.length; i < l; i++) {
|
||||
let child = children[i];
|
||||
if (child) {
|
||||
child.moveBeforeVNode(null, afterNode);
|
||||
child.moveBefore(null, afterNode);
|
||||
} else {
|
||||
const anchor = anchors![i];
|
||||
nodeInsertBefore.call(parent, anchor, afterNode);
|
||||
|
||||
@@ -23,13 +23,9 @@ abstract class VSimpleNode {
|
||||
this.el = node;
|
||||
}
|
||||
|
||||
moveBeforeDOMNode(node: Node | null, parent = this.parentEl) {
|
||||
this.parentEl = parent;
|
||||
nodeInsertBefore.call(parent, this.el!, node);
|
||||
}
|
||||
|
||||
moveBeforeVNode(other: VText | null, afterNode: Node | null) {
|
||||
nodeInsertBefore.call(this.parentEl, this.el!, other ? other.el! : afterNode);
|
||||
moveBefore(other: VText | null, afterNode: Node | null) {
|
||||
const target = other ? other.el! : afterNode;
|
||||
nodeInsertBefore.call(this.parentEl, this.el!, target);
|
||||
}
|
||||
|
||||
beforeRemove() {}
|
||||
|
||||
@@ -20,12 +20,8 @@ class VToggler {
|
||||
this.child.mount(parent, afterNode);
|
||||
}
|
||||
|
||||
moveBeforeDOMNode(node: Node | null, parent?: HTMLElement) {
|
||||
this.child.moveBeforeDOMNode(node, parent);
|
||||
}
|
||||
|
||||
moveBeforeVNode(other: VToggler | null, afterNode: Node | null) {
|
||||
this.moveBeforeDOMNode((other && other.firstNode()) || afterNode);
|
||||
moveBefore(other: VToggler | null, afterNode: Node | null) {
|
||||
this.child.moveBefore(other ? other.child : null, afterNode);
|
||||
}
|
||||
|
||||
patch(other: VToggler, withBeforeRemove: boolean) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { App, Env } from "./app";
|
||||
import { BDom, VNode } from "./blockdom";
|
||||
import { Component, ComponentConstructor, Props } from "./component";
|
||||
import { fibersInError, OwlError } from "./error_handling";
|
||||
import { fibersInError, handleError } from "./error_handling";
|
||||
import { Fiber, makeChildFiber, makeRootFiber, MountFiber, MountOptions } from "./fibers";
|
||||
import {
|
||||
clearReactivesForCallback,
|
||||
@@ -18,7 +18,7 @@ let currentNode: ComponentNode | null = null;
|
||||
|
||||
export function getCurrent(): ComponentNode {
|
||||
if (!currentNode) {
|
||||
throw new OwlError("No active component (a hook function should only be called in 'setup')");
|
||||
throw new Error("No active component (a hook function should only be called in 'setup')");
|
||||
}
|
||||
return currentNode;
|
||||
}
|
||||
@@ -83,6 +83,7 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
|
||||
|
||||
renderFn: Function;
|
||||
parent: ComponentNode | null;
|
||||
level: number;
|
||||
childEnv: Env;
|
||||
children: { [key: string]: ComponentNode } = Object.create(null);
|
||||
refs: any = {};
|
||||
@@ -107,6 +108,7 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
|
||||
this.parent = parent;
|
||||
this.props = props;
|
||||
this.parentKey = parentKey;
|
||||
this.level = parent ? parent.level + 1 : 0;
|
||||
const defaultProps = C.defaultProps;
|
||||
props = Object.assign({}, props);
|
||||
if (defaultProps) {
|
||||
@@ -141,7 +143,7 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
|
||||
try {
|
||||
await Promise.all(this.willStart.map((f) => f.call(component)));
|
||||
} catch (e) {
|
||||
this.app.handleError({ node: this, error: e });
|
||||
handleError({ node: this, error: e });
|
||||
return;
|
||||
}
|
||||
if (this.status === STATUS.NEW && this.fiber === fiber) {
|
||||
@@ -219,7 +221,7 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
|
||||
cb.call(component);
|
||||
}
|
||||
} catch (e) {
|
||||
this.app.handleError({ error: e, node: this });
|
||||
handleError({ error: e, node: this });
|
||||
}
|
||||
}
|
||||
this.status = STATUS.DESTROYED;
|
||||
@@ -306,12 +308,8 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
|
||||
this.fiber = null;
|
||||
}
|
||||
|
||||
moveBeforeDOMNode(node: Node | null, parent?: HTMLElement): void {
|
||||
this.bdom!.moveBeforeDOMNode(node, parent);
|
||||
}
|
||||
|
||||
moveBeforeVNode(other: ComponentNode<P, E> | null, afterNode: Node | null) {
|
||||
this.bdom!.moveBeforeVNode(other ? other.bdom : null, afterNode);
|
||||
moveBefore(other: ComponentNode | null, afterNode: Node | null) {
|
||||
this.bdom!.moveBefore(other ? other.bdom : null, afterNode);
|
||||
}
|
||||
|
||||
patch() {
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import type { ComponentNode } from "./component_node";
|
||||
import type { Fiber } from "./fibers";
|
||||
|
||||
// Custom error class that wraps error that happen in the owl lifecycle
|
||||
export class OwlError extends Error {
|
||||
cause?: any;
|
||||
}
|
||||
|
||||
// Maps fibers to thrown errors
|
||||
export const fibersInError: WeakMap<Fiber, any> = new WeakMap();
|
||||
export const nodeErrorHandlers: WeakMap<ComponentNode, ((error: any) => void)[]> = new WeakMap();
|
||||
@@ -42,14 +37,7 @@ function _handleError(node: ComponentNode | null, error: any): boolean {
|
||||
|
||||
type ErrorParams = { error: any } & ({ node: ComponentNode } | { fiber: Fiber });
|
||||
export function handleError(params: ErrorParams) {
|
||||
let { error } = params;
|
||||
// Wrap error if it wasn't wrapped by wrapError (ie when not in dev mode)
|
||||
if (!(error instanceof OwlError)) {
|
||||
error = Object.assign(
|
||||
new OwlError(`An error occured in the owl lifecycle (see this Error's "cause" property)`),
|
||||
{ cause: error }
|
||||
);
|
||||
}
|
||||
const error = params.error;
|
||||
const node = "node" in params ? params.node : params.fiber.node;
|
||||
const fiber = "fiber" in params ? params.fiber : node.fiber!;
|
||||
|
||||
@@ -71,6 +59,5 @@ export function handleError(params: ErrorParams) {
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { filterOutModifiersFromData } from "./blockdom/config";
|
||||
import { STATUS } from "./status";
|
||||
import { OwlError } from "./error_handling";
|
||||
|
||||
export const mainEventHandler = (data: any, ev: Event, currentTarget?: EventTarget | null) => {
|
||||
const { data: _data, modifiers } = filterOutModifiersFromData(data);
|
||||
@@ -34,7 +33,7 @@ export const mainEventHandler = (data: any, ev: Event, currentTarget?: EventTarg
|
||||
if (Object.hasOwnProperty.call(data, 0)) {
|
||||
const handler = data[0];
|
||||
if (typeof handler !== "function") {
|
||||
throw new OwlError(`Invalid handler (expected a function, received: '${handler}')`);
|
||||
throw new Error(`Invalid handler (expected a function, received: '${handler}')`);
|
||||
}
|
||||
let node = data[1] ? data[1].__owl__ : null;
|
||||
if (node ? node.status === STATUS.MOUNTED : true) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BDom, mount } from "./blockdom";
|
||||
import type { ComponentNode } from "./component_node";
|
||||
import { fibersInError, OwlError } from "./error_handling";
|
||||
import { fibersInError, handleError } from "./error_handling";
|
||||
import { STATUS } from "./status";
|
||||
|
||||
export function makeChildFiber(node: ComponentNode, parent: Fiber): Fiber {
|
||||
@@ -43,7 +43,7 @@ export function makeRootFiber(node: ComponentNode): Fiber {
|
||||
}
|
||||
|
||||
function throwOnRender() {
|
||||
throw new OwlError("Attempted to render cancelled fiber");
|
||||
throw new Error("Attempted to render cancelled fiber");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,6 @@ function cancelFibers(fibers: Fiber[]): number {
|
||||
fiber.render = throwOnRender;
|
||||
if (node.status === STATUS.NEW) {
|
||||
node.destroy();
|
||||
delete node.parent!.children[node.parentKey!];
|
||||
}
|
||||
node.fiber = null;
|
||||
if (fiber.bdom) {
|
||||
@@ -130,7 +129,7 @@ export class Fiber {
|
||||
(this.bdom as any) = true;
|
||||
this.bdom = node.renderFn();
|
||||
} catch (e) {
|
||||
node.app.handleError({ node, error: e });
|
||||
handleError({ node, error: e });
|
||||
}
|
||||
root.setCounter(root.counter - 1);
|
||||
}
|
||||
@@ -195,7 +194,7 @@ export class RootFiber extends Fiber {
|
||||
}
|
||||
} catch (e) {
|
||||
this.locked = false;
|
||||
node.app.handleError({ fiber: current || this, error: e });
|
||||
handleError({ fiber: current || this, error: e });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +258,7 @@ export class MountFiber extends RootFiber {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
this.node.app.handleError({ fiber: current as Fiber, error: e });
|
||||
handleError({ fiber: current as Fiber, error: e });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ export const blockDom = {
|
||||
export { App, mount } from "./app";
|
||||
export { xml } from "./template_set";
|
||||
export { Component } from "./component";
|
||||
export type { ComponentConstructor } from "./component";
|
||||
export { useComponent, useState } from "./component_node";
|
||||
export { status } from "./status";
|
||||
export { reactive, markRaw, toRaw } from "./reactivity";
|
||||
@@ -55,6 +54,5 @@ export {
|
||||
onError,
|
||||
} from "./lifecycle_hooks";
|
||||
export { validate } from "./validation";
|
||||
export { OwlError } from "./error_handling";
|
||||
|
||||
export const __info__ = {};
|
||||
|
||||
@@ -1,30 +1,21 @@
|
||||
import { getCurrent } from "./component_node";
|
||||
import { nodeErrorHandlers, OwlError } from "./error_handling";
|
||||
import { nodeErrorHandlers } from "./error_handling";
|
||||
|
||||
const TIMEOUT = Symbol("timeout");
|
||||
function wrapError(fn: (...args: any[]) => any, hookName: string) {
|
||||
const error = new OwlError(`The following error occurred in ${hookName}: `) as Error & {
|
||||
const error = new Error(`The following error occurred in ${hookName}: `) as Error & {
|
||||
cause: any;
|
||||
};
|
||||
const timeoutError = new OwlError(`${hookName}'s promise hasn't resolved after 3 seconds`);
|
||||
const timeoutError = new Error(`${hookName}'s promise hasn't resolved after 3 seconds`);
|
||||
const node = getCurrent();
|
||||
return (...args: any[]) => {
|
||||
const onError = (cause: any) => {
|
||||
error.cause = cause;
|
||||
if (cause instanceof Error) {
|
||||
error.message += `"${cause.message}"`;
|
||||
} else {
|
||||
error.message = `Something that is not an Error was thrown in ${hookName} (see this Error's "cause" property)`;
|
||||
}
|
||||
throw error;
|
||||
};
|
||||
try {
|
||||
const result = fn(...args);
|
||||
if (result instanceof Promise) {
|
||||
if (hookName === "onWillStart" || hookName === "onWillUpdateProps") {
|
||||
const fiber = node.fiber;
|
||||
Promise.race([
|
||||
result.catch(() => {}),
|
||||
result,
|
||||
new Promise((resolve) => setTimeout(() => resolve(TIMEOUT), 3000)),
|
||||
]).then((res) => {
|
||||
if (res === TIMEOUT && node.fiber === fiber) {
|
||||
@@ -32,11 +23,20 @@ function wrapError(fn: (...args: any[]) => any, hookName: string) {
|
||||
}
|
||||
});
|
||||
}
|
||||
return result.catch(onError);
|
||||
return result.catch((cause) => {
|
||||
error.cause = cause;
|
||||
if (cause instanceof Error) {
|
||||
error.message += `"${cause.message}"`;
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
return result;
|
||||
} catch (cause) {
|
||||
onError(cause);
|
||||
if (cause instanceof Error) {
|
||||
error.message += `"${cause.message}"`;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+32
-38
@@ -1,60 +1,64 @@
|
||||
import { onMounted, onWillUnmount } from "./lifecycle_hooks";
|
||||
import { onWillUnmount } from "./lifecycle_hooks";
|
||||
import { BDom, text, VNode } from "./blockdom";
|
||||
import { Component } from "./component";
|
||||
import { OwlError } from "./error_handling";
|
||||
|
||||
const VText: any = text("").constructor;
|
||||
|
||||
class VPortal extends VText implements Partial<VNode<VPortal>> {
|
||||
content: BDom | null;
|
||||
selector: string;
|
||||
// selector: string;
|
||||
realBDom: BDom | null;
|
||||
target: HTMLElement | null = null;
|
||||
|
||||
constructor(selector: string, content: BDom) {
|
||||
constructor(selector: string, realBDom: BDom) {
|
||||
super("");
|
||||
this.selector = selector;
|
||||
this.content = content;
|
||||
this.realBDom = realBDom;
|
||||
}
|
||||
|
||||
mount(parent: HTMLElement, anchor: ChildNode) {
|
||||
super.mount(parent, anchor);
|
||||
this.target = document.querySelector(this.selector) as any;
|
||||
if (this.target) {
|
||||
this.content!.mount(this.target!, null);
|
||||
} else {
|
||||
this.content!.mount(parent, anchor);
|
||||
if (!this.target) {
|
||||
let el: any = this.el;
|
||||
while (el && el.parentElement instanceof HTMLElement) {
|
||||
el = el.parentElement;
|
||||
}
|
||||
this.target = el && el.querySelector(this.selector);
|
||||
if (!this.target) {
|
||||
throw new Error("invalid portal target");
|
||||
}
|
||||
}
|
||||
this.realBDom!.mount(this.target!, null);
|
||||
}
|
||||
|
||||
beforeRemove() {
|
||||
this.content!.beforeRemove();
|
||||
this.realBDom!.beforeRemove();
|
||||
}
|
||||
remove() {
|
||||
if (this.content) {
|
||||
if (this.realBDom) {
|
||||
super.remove();
|
||||
this.content!.remove();
|
||||
this.content = null;
|
||||
this.realBDom!.remove();
|
||||
this.realBDom = null;
|
||||
}
|
||||
}
|
||||
|
||||
patch(other: VPortal) {
|
||||
super.patch(other);
|
||||
if (this.content) {
|
||||
this.content.patch(other.content!, true);
|
||||
if (this.realBDom) {
|
||||
this.realBDom.patch(other.realBDom!, true);
|
||||
} else {
|
||||
this.content = other.content;
|
||||
this.content!.mount(this.target!, null);
|
||||
this.realBDom = other.realBDom;
|
||||
this.realBDom!.mount(this.target!, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* kind of similar to <t t-slot="default"/>, but it wraps it around a VPortal
|
||||
* <t t-slot="default"/>
|
||||
*/
|
||||
export function portalTemplate(app: any, bdom: any, helpers: any) {
|
||||
let { callSlot } = helpers;
|
||||
return function template(ctx: any, node: any, key = ""): any {
|
||||
return new VPortal(ctx.props.target, callSlot(ctx, node, key, "default", false, null));
|
||||
return function template(ctx: any, node: any, key = "") {
|
||||
return callSlot(ctx, node, key, "default", false, null);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -68,23 +72,13 @@ export class Portal extends Component {
|
||||
};
|
||||
|
||||
setup() {
|
||||
const node: any = this.__owl__;
|
||||
|
||||
onMounted(() => {
|
||||
const portal: VPortal = node.bdom;
|
||||
if (!portal.target) {
|
||||
const target: HTMLElement = document.querySelector(this.props.target);
|
||||
if (target) {
|
||||
portal.content!.moveBeforeDOMNode(target.firstChild, target);
|
||||
} else {
|
||||
throw new OwlError("invalid portal target");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const node = this.__owl__;
|
||||
const renderFn = node.renderFn;
|
||||
node.renderFn = () => new VPortal(this.props.target, renderFn());
|
||||
onWillUnmount(() => {
|
||||
const portal: VPortal = node.bdom;
|
||||
portal.remove();
|
||||
if (node.bdom) {
|
||||
node.bdom.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Callback } from "./utils";
|
||||
import { OwlError } from "./error_handling";
|
||||
|
||||
// Allows to get the target of a Reactive (used for making a new Reactive from the underlying object)
|
||||
export const TARGET = Symbol("Target");
|
||||
@@ -198,7 +197,7 @@ export function reactive<T extends Target>(
|
||||
callback: Callback = () => {}
|
||||
): Reactive<T> | NonReactive<T> {
|
||||
if (!canBeMadeReactive(target)) {
|
||||
throw new OwlError(`Cannot make the given value reactive`);
|
||||
throw new Error(`Cannot make the given value reactive`);
|
||||
}
|
||||
if (SKIP in target) {
|
||||
return target as NonReactive<T>;
|
||||
|
||||
@@ -4,7 +4,6 @@ import { html } from "./blockdom/index";
|
||||
import { isOptional, validateSchema } from "./validation";
|
||||
import type { ComponentConstructor } from "./component";
|
||||
import { markRaw } from "./reactivity";
|
||||
import { OwlError } from "./error_handling";
|
||||
|
||||
const ObjectCreate = Object.create;
|
||||
/**
|
||||
@@ -71,7 +70,7 @@ function prepareList(collection: any): [any[], any[], number, any[]] {
|
||||
values = Object.keys(collection);
|
||||
keys = Object.values(collection);
|
||||
} else {
|
||||
throw new OwlError("Invalid loop expression");
|
||||
throw new Error("Invalid loop expression");
|
||||
}
|
||||
const n = values.length;
|
||||
return [keys, values, n, new Array(n)];
|
||||
@@ -111,18 +110,15 @@ class LazyValue {
|
||||
ctx: any;
|
||||
component: any;
|
||||
node: any;
|
||||
key: any;
|
||||
|
||||
constructor(fn: any, ctx: any, component: any, node: any, key: any) {
|
||||
constructor(fn: any, ctx: any, component: any, node: any) {
|
||||
this.fn = fn;
|
||||
this.ctx = capture(ctx);
|
||||
this.component = component;
|
||||
this.node = node;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
evaluate(): any {
|
||||
return this.fn.call(this.component, this.ctx, this.node, this.key);
|
||||
return this.fn.call(this.component, this.ctx, this.node);
|
||||
}
|
||||
|
||||
toString() {
|
||||
@@ -133,9 +129,9 @@ class LazyValue {
|
||||
/*
|
||||
* Safely outputs `value` as a block depending on the nature of `value`
|
||||
*/
|
||||
export function safeOutput(value: any, defaultValue?: any): ReturnType<typeof toggler> {
|
||||
if (value === undefined) {
|
||||
return defaultValue ? toggler("default", defaultValue) : toggler("undefined", text(""));
|
||||
export function safeOutput(value: any): ReturnType<typeof toggler> {
|
||||
if (!value) {
|
||||
return value;
|
||||
}
|
||||
let safeKey;
|
||||
let block;
|
||||
@@ -195,7 +191,7 @@ function multiRefSetter(refs: RefMap, name: string): RefSetter {
|
||||
if (el) {
|
||||
count++;
|
||||
if (count > 1) {
|
||||
throw new OwlError("Cannot have 2 elements with same ref name at the same time");
|
||||
throw new Error("Cannot have 2 elements with same ref name at the same time");
|
||||
}
|
||||
}
|
||||
if (count === 0 || el) {
|
||||
@@ -210,11 +206,11 @@ function multiRefSetter(refs: RefMap, name: string): RefSetter {
|
||||
* visit recursively the props and all the children to check if they are valid.
|
||||
* This is why it is only done in 'dev' mode.
|
||||
*/
|
||||
export function validateProps<P>(name: string | ComponentConstructor<P>, props: P, comp?: any) {
|
||||
export function validateProps<P>(name: string | ComponentConstructor<P>, props: P, parent?: any) {
|
||||
const ComponentClass =
|
||||
typeof name !== "string"
|
||||
? name
|
||||
: (comp.constructor.components[name] as ComponentConstructor<P> | undefined);
|
||||
: (parent.constructor.components[name] as ComponentConstructor<P> | undefined);
|
||||
|
||||
if (!ComponentClass) {
|
||||
// this is an error, wrong component. We silently return here instead so the
|
||||
@@ -224,7 +220,7 @@ export function validateProps<P>(name: string | ComponentConstructor<P>, props:
|
||||
|
||||
const schema = ComponentClass.props;
|
||||
if (!schema) {
|
||||
if (comp.__owl__.app.warnIfNoStaticProps) {
|
||||
if (parent.__owl__.app.warnIfNoStaticProps) {
|
||||
console.warn(`Component '${ComponentClass.name}' does not have a static props description`);
|
||||
}
|
||||
return;
|
||||
@@ -237,7 +233,7 @@ export function validateProps<P>(name: string | ComponentConstructor<P>, props:
|
||||
: name in schema && !("*" in schema) && !isOptional(schema[name]);
|
||||
for (let p in defaultProps) {
|
||||
if (isMandatory(p)) {
|
||||
throw new OwlError(
|
||||
throw new Error(
|
||||
`A default value cannot be defined for a mandatory prop (name: '${p}', component: ${ComponentClass.name})`
|
||||
);
|
||||
}
|
||||
@@ -246,9 +242,7 @@ export function validateProps<P>(name: string | ComponentConstructor<P>, props:
|
||||
|
||||
const errors = validateSchema(props, schema);
|
||||
if (errors.length) {
|
||||
throw new OwlError(
|
||||
`Invalid props for component '${ComponentClass.name}': ` + errors.join(", ")
|
||||
);
|
||||
throw new Error(`Invalid props for component '${ComponentClass.name}': ` + errors.join(", "));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,5 +264,4 @@ export const helpers = {
|
||||
bind,
|
||||
createCatcher,
|
||||
markRaw,
|
||||
OwlError,
|
||||
};
|
||||
|
||||
@@ -3,7 +3,6 @@ import { comment, createBlock, html, list, multi, text, toggler } from "./blockd
|
||||
import { getCurrent } from "./component_node";
|
||||
import { Portal, portalTemplate } from "./portal";
|
||||
import { helpers } from "./template_helpers";
|
||||
import { OwlError } from "./error_handling";
|
||||
|
||||
const bdom = { text, createBlock, list, multi, html, toggler, comment };
|
||||
|
||||
@@ -32,7 +31,7 @@ function parseXML(xml: string): Document {
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new OwlError(msg);
|
||||
throw new Error(msg);
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
@@ -77,7 +76,7 @@ export class TemplateSet {
|
||||
if (currentAsString === newAsString) {
|
||||
return;
|
||||
}
|
||||
throw new OwlError(`Template ${name} already defined with different content`);
|
||||
throw new Error(`Template ${name} already defined with different content`);
|
||||
}
|
||||
this.rawTemplates[name] = template;
|
||||
}
|
||||
@@ -103,7 +102,7 @@ export class TemplateSet {
|
||||
const componentName = getCurrent().component.constructor.name;
|
||||
extraInfo = ` (for component "${componentName}")`;
|
||||
} catch {}
|
||||
throw new OwlError(`Missing template: "${name}"${extraInfo}`);
|
||||
throw new Error(`Missing template: "${name}"${extraInfo}`);
|
||||
}
|
||||
const isFn = typeof rawTemplate === "function" && !(rawTemplate instanceof Element);
|
||||
const templateFn = isFn ? rawTemplate : this._compileTemplate(name, rawTemplate);
|
||||
@@ -120,7 +119,7 @@ export class TemplateSet {
|
||||
}
|
||||
|
||||
_compileTemplate(name: string, template: string | Element): ReturnType<typeof compile> {
|
||||
throw new OwlError(`Unable to compile a template. Please use owl full build instead`);
|
||||
throw new Error(`Unable to compile a template. Please use owl full build instead`);
|
||||
}
|
||||
|
||||
callTemplate(owner: any, subTemplate: string, ctx: any, parent: any, key: any): any {
|
||||
|
||||
+6
-13
@@ -1,4 +1,3 @@
|
||||
import { OwlError } from "./error_handling";
|
||||
export type Callback = () => void;
|
||||
|
||||
/**
|
||||
@@ -28,18 +27,12 @@ export function batched(callback: Callback): Callback {
|
||||
}
|
||||
|
||||
export function validateTarget(target: HTMLElement) {
|
||||
// Get the document and HTMLElement corresponding to the target to allow mounting in iframes
|
||||
const document = target && target.ownerDocument;
|
||||
if (document) {
|
||||
const HTMLElement = document.defaultView!.HTMLElement;
|
||||
if (target instanceof HTMLElement) {
|
||||
if (!document.body.contains(target)) {
|
||||
throw new OwlError("Cannot mount a component on a detached dom node");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!(target instanceof HTMLElement)) {
|
||||
throw new Error("Cannot mount component: the target is not a valid DOM element");
|
||||
}
|
||||
if (!document.body.contains(target)) {
|
||||
throw new Error("Cannot mount a component on a detached dom node");
|
||||
}
|
||||
throw new OwlError("Cannot mount component: the target is not a valid DOM element");
|
||||
}
|
||||
|
||||
export class EventBus extends EventTarget {
|
||||
@@ -61,7 +54,7 @@ export function whenReady(fn?: any): Promise<void> {
|
||||
export async function loadFile(url: string): Promise<string> {
|
||||
const result = await fetch(url);
|
||||
if (!result.ok) {
|
||||
throw new OwlError("Error while fetching xml templates");
|
||||
throw new Error("Error while fetching xml templates");
|
||||
}
|
||||
return await result.text();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { OwlError } from "./error_handling";
|
||||
|
||||
type BaseType =
|
||||
| typeof String
|
||||
| typeof Boolean
|
||||
@@ -72,7 +70,7 @@ function toSchema(spec: SimplifiedSchema): NormalizedSchema {
|
||||
export function validate(obj: { [key: string]: any }, spec: Schema) {
|
||||
let errors = validateSchema(obj, spec);
|
||||
if (errors.length) {
|
||||
throw new OwlError("Invalid object: " + errors.join(", "));
|
||||
throw new Error("Invalid object: " + errors.join(", "));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ exports[`Reactivity: useState concurrent renderings 3`] = `
|
||||
exports[`Reactivity: useState destroyed component before being mounted is inactive 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -67,6 +68,7 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti
|
||||
exports[`Reactivity: useState destroyed component before being mounted is inactive 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -81,6 +83,7 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti
|
||||
exports[`Reactivity: useState destroyed component is inactive 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -99,6 +102,7 @@ exports[`Reactivity: useState destroyed component is inactive 1`] = `
|
||||
exports[`Reactivity: useState destroyed component is inactive 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -113,6 +117,7 @@ exports[`Reactivity: useState destroyed component is inactive 2`] = `
|
||||
exports[`Reactivity: useState one components can subscribe twice to same context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
@@ -128,6 +133,7 @@ exports[`Reactivity: useState one components can subscribe twice to same context
|
||||
exports[`Reactivity: useState parent and children subscribed to same context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -144,6 +150,7 @@ exports[`Reactivity: useState parent and children subscribed to same context 1`]
|
||||
exports[`Reactivity: useState parent and children subscribed to same context 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -221,6 +228,7 @@ exports[`Reactivity: useState several nodes on different level use same context
|
||||
exports[`Reactivity: useState two components are updated in parallel 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -238,6 +246,7 @@ exports[`Reactivity: useState two components are updated in parallel 1`] = `
|
||||
exports[`Reactivity: useState two components are updated in parallel 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -252,6 +261,7 @@ exports[`Reactivity: useState two components are updated in parallel 2`] = `
|
||||
exports[`Reactivity: useState two components can subscribe to same context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -269,6 +279,7 @@ exports[`Reactivity: useState two components can subscribe to same context 1`] =
|
||||
exports[`Reactivity: useState two components can subscribe to same context 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -283,6 +294,7 @@ exports[`Reactivity: useState two components can subscribe to same context 2`] =
|
||||
exports[`Reactivity: useState two independent components on different levels are updated in parallel 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Parent\`, true, false, false, true);
|
||||
@@ -300,6 +312,7 @@ exports[`Reactivity: useState two independent components on different levels are
|
||||
exports[`Reactivity: useState two independent components on different levels are updated in parallel 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -314,6 +327,7 @@ exports[`Reactivity: useState two independent components on different levels are
|
||||
exports[`Reactivity: useState two independent components on different levels are updated in parallel 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -329,6 +343,7 @@ exports[`Reactivity: useState two independent components on different levels are
|
||||
exports[`Reactivity: useState useContext=useState hook is reactive, for one component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -343,6 +358,7 @@ exports[`Reactivity: useState useContext=useState hook is reactive, for one comp
|
||||
exports[`Reactivity: useState useless atoms should be deleted 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Quantity\`, true, false, false, false);
|
||||
@@ -369,6 +385,7 @@ exports[`Reactivity: useState useless atoms should be deleted 1`] = `
|
||||
exports[`Reactivity: useState useless atoms should be deleted 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -383,6 +400,7 @@ exports[`Reactivity: useState useless atoms should be deleted 2`] = `
|
||||
exports[`Reactivity: useState very simple use, with initial value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`app App supports env with getters/setters 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
||||
@@ -18,6 +19,7 @@ exports[`app App supports env with getters/setters 1`] = `
|
||||
exports[`app can configure an app with props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -29,22 +31,10 @@ exports[`app can configure an app with props 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`app can mount app in an iframe 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"my-div\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`app destroy remove the widget from the DOM 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -58,6 +48,7 @@ exports[`app destroy remove the widget from the DOM 1`] = `
|
||||
exports[`app warnIfNoStaticProps works as expected 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
@@ -76,22 +76,4 @@ describe("app", () => {
|
||||
"Component 'Root' does not have a static props description"
|
||||
);
|
||||
});
|
||||
|
||||
test("can mount app in an iframe", async () => {
|
||||
class SomeComponent extends Component {
|
||||
static template = xml`<div class="my-div"/>`;
|
||||
}
|
||||
|
||||
const iframe = document.createElement("iframe");
|
||||
fixture.appendChild(iframe);
|
||||
const app = new App(SomeComponent);
|
||||
const iframeDoc = iframe.contentDocument!;
|
||||
const comp = await app.mount(iframeDoc.body);
|
||||
const div = iframeDoc.querySelector(".my-div");
|
||||
expect(div).not.toBe(null);
|
||||
expect(iframeDoc.contains(div)).toBe(true);
|
||||
app.destroy();
|
||||
expect(iframeDoc.contains(div)).toBe(false);
|
||||
expect(status(comp)).toBe("destroyed");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`attributes changing a class with t-att-class (preexisting class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = `
|
||||
exports[`attributes changing a class with t-att-class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -31,6 +33,7 @@ exports[`attributes changing a class with t-att-class 1`] = `
|
||||
exports[`attributes changing an attribute with t-att- 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"value\\"/>\`);
|
||||
@@ -45,6 +48,7 @@ exports[`attributes changing an attribute with t-att- 1`] = `
|
||||
exports[`attributes class and t-att-class should combine together 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\" class=\\"hello\\"/>\`);
|
||||
@@ -59,6 +63,7 @@ exports[`attributes class and t-att-class should combine together 1`] = `
|
||||
exports[`attributes class and t-attf-class with ternary operation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -73,6 +78,7 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = `
|
||||
exports[`attributes dynamic attribute evaluating to 0 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -87,6 +93,7 @@ exports[`attributes dynamic attribute evaluating to 0 1`] = `
|
||||
exports[`attributes dynamic attribute falsy variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -101,6 +108,7 @@ exports[`attributes dynamic attribute falsy variable 1`] = `
|
||||
exports[`attributes dynamic attribute with a dash 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"data-action-id\\"/>\`);
|
||||
@@ -115,6 +123,7 @@ exports[`attributes dynamic attribute with a dash 1`] = `
|
||||
exports[`attributes dynamic attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -129,6 +138,7 @@ exports[`attributes dynamic attributes 1`] = `
|
||||
exports[`attributes dynamic attributes with backticks 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -143,6 +153,7 @@ exports[`attributes dynamic attributes with backticks 1`] = `
|
||||
exports[`attributes dynamic class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -157,6 +168,7 @@ exports[`attributes dynamic class attribute 1`] = `
|
||||
exports[`attributes dynamic class attribute evaluating to 0 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -171,6 +183,7 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = `
|
||||
exports[`attributes dynamic class attribute that starts and ends with a space 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -185,6 +198,7 @@ exports[`attributes dynamic class attribute that starts and ends with a space 1`
|
||||
exports[`attributes dynamic class attribute which is only a space 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -199,6 +213,7 @@ exports[`attributes dynamic class attribute which is only a space 1`] = `
|
||||
exports[`attributes dynamic class attribute with multiple consecutive spaces 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -213,6 +228,7 @@ exports[`attributes dynamic class attribute with multiple consecutive spaces 1`]
|
||||
exports[`attributes dynamic empty class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -227,6 +243,7 @@ exports[`attributes dynamic empty class attribute 1`] = `
|
||||
exports[`attributes dynamic formatted attributes with a dash 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"aria-label\\"/>\`);
|
||||
@@ -241,6 +258,7 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = `
|
||||
exports[`attributes dynamic undefined class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -255,6 +273,7 @@ exports[`attributes dynamic undefined class attribute 1`] = `
|
||||
exports[`attributes dynamic undefined generic attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"thing\\"/>\`);
|
||||
@@ -269,6 +288,7 @@ exports[`attributes dynamic undefined generic attribute 1`] = `
|
||||
exports[`attributes fixed variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -283,6 +303,7 @@ exports[`attributes fixed variable 1`] = `
|
||||
exports[`attributes format expression 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -297,6 +318,7 @@ exports[`attributes format expression 1`] = `
|
||||
exports[`attributes format literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -311,6 +333,7 @@ exports[`attributes format literal 1`] = `
|
||||
exports[`attributes format multiple 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -325,6 +348,7 @@ exports[`attributes format multiple 1`] = `
|
||||
exports[`attributes format value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -339,6 +363,7 @@ exports[`attributes format value 1`] = `
|
||||
exports[`attributes from object variables set previously 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -357,6 +382,7 @@ exports[`attributes from object variables set previously 1`] = `
|
||||
exports[`attributes from variables set previously (no external node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -375,6 +401,7 @@ exports[`attributes from variables set previously (no external node) 1`] = `
|
||||
exports[`attributes from variables set previously 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -393,6 +420,7 @@ exports[`attributes from variables set previously 1`] = `
|
||||
exports[`attributes object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
@@ -407,6 +435,7 @@ exports[`attributes object 1`] = `
|
||||
exports[`attributes static attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div foo=\\"a\\" bar=\\"b\\" baz=\\"c\\"/>\`);
|
||||
@@ -420,6 +449,7 @@ exports[`attributes static attributes 1`] = `
|
||||
exports[`attributes static attributes on void elements 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<img src=\\"/test.skip.jpg\\" alt=\\"Test\\"/>\`);
|
||||
@@ -433,6 +463,7 @@ exports[`attributes static attributes on void elements 1`] = `
|
||||
exports[`attributes static attributes with backticks 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div foo=\\"\\\\\`bar\\\\\`\\"/>\`);
|
||||
@@ -446,6 +477,7 @@ exports[`attributes static attributes with backticks 1`] = `
|
||||
exports[`attributes static attributes with dashes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div aria-label=\\"Close\\"/>\`);
|
||||
@@ -459,6 +491,7 @@ exports[`attributes static attributes with dashes 1`] = `
|
||||
exports[`attributes string interpolation, alternate syntax 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
@@ -473,6 +506,7 @@ exports[`attributes string interpolation, alternate syntax 1`] = `
|
||||
exports[`attributes t-att-class and class should combine together 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -487,6 +521,7 @@ exports[`attributes t-att-class and class should combine together 1`] = `
|
||||
exports[`attributes t-att-class with multiple classes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -501,6 +536,7 @@ exports[`attributes t-att-class with multiple classes 1`] = `
|
||||
exports[`attributes t-att-class with multiple classes 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -515,6 +551,7 @@ exports[`attributes t-att-class with multiple classes 2`] = `
|
||||
exports[`attributes t-att-class with multiple classes 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -529,6 +566,7 @@ exports[`attributes t-att-class with multiple classes 3`] = `
|
||||
exports[`attributes t-att-class with multiple classes, some of which are duplicate 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -543,6 +581,7 @@ exports[`attributes t-att-class with multiple classes, some of which are duplica
|
||||
exports[`attributes t-att-class with object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"static\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -557,6 +596,7 @@ exports[`attributes t-att-class with object 1`] = `
|
||||
exports[`attributes t-att-class with object 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -571,6 +611,7 @@ exports[`attributes t-att-class with object 2`] = `
|
||||
exports[`attributes t-att-class with object 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -585,6 +626,7 @@ exports[`attributes t-att-class with object 3`] = `
|
||||
exports[`attributes t-attf-class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -599,6 +641,7 @@ exports[`attributes t-attf-class 1`] = `
|
||||
exports[`attributes t-attf-class should combine with class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -613,6 +656,7 @@ exports[`attributes t-attf-class should combine with class 1`] = `
|
||||
exports[`attributes t-attf-class with multiple classes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -627,6 +671,7 @@ exports[`attributes t-attf-class with multiple classes 1`] = `
|
||||
exports[`attributes t-attf-class with multiple classes separated by multiple spaces 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -641,6 +686,7 @@ exports[`attributes t-attf-class with multiple classes separated by multiple spa
|
||||
exports[`attributes tuple literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
@@ -655,6 +701,7 @@ exports[`attributes tuple literal 1`] = `
|
||||
exports[`attributes tuple variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
@@ -669,6 +716,7 @@ exports[`attributes tuple variable 1`] = `
|
||||
exports[`attributes two classes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"a b\\"/>\`);
|
||||
@@ -682,6 +730,7 @@ exports[`attributes two classes 1`] = `
|
||||
exports[`attributes two dynamic attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\" block-attribute-1=\\"bar\\"/>\`);
|
||||
@@ -697,6 +746,7 @@ exports[`attributes two dynamic attributes 1`] = `
|
||||
exports[`attributes updating classes (with obj notation) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -708,23 +758,10 @@ exports[`attributes updating classes (with obj notation) 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`attributes updating property with falsy value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input block-attribute-0=\\"value\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let attr1 = new String((ctx['v']) || \\"\\");
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`attributes various escapes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div foo=\\"<foo\\" block-attribute-0=\\"bar\\" block-attribute-1=\\"baz\\" block-attributes=\\"2\\"/>\`);
|
||||
@@ -741,6 +778,7 @@ exports[`attributes various escapes 1`] = `
|
||||
exports[`attributes various escapes 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div> < </div>\`);
|
||||
@@ -754,12 +792,13 @@ exports[`attributes various escapes 2 1`] = `
|
||||
exports[`special cases for some specific html attributes/properties input of type checkbox with t-att-indeterminate 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"indeterminate\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let attr1 = new Boolean(ctx['v']);
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
@@ -768,26 +807,13 @@ exports[`special cases for some specific html attributes/properties input of typ
|
||||
exports[`special cases for some specific html attributes/properties input type= checkbox, with t-att-checked 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"checked\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let attr1 = new Boolean(ctx['flag']);
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`special cases for some specific html attributes/properties input with t-att-value (patching with same value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input block-attribute-0=\\"value\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let attr1 = new String((ctx['v']) || \\"\\");
|
||||
let attr1 = ctx['flag'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
@@ -796,26 +822,13 @@ exports[`special cases for some specific html attributes/properties input with t
|
||||
exports[`special cases for some specific html attributes/properties input with t-att-value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input block-attribute-0=\\"value\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let attr1 = new String((ctx['v']) || \\"\\");
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`special cases for some specific html attributes/properties input, type checkbox, with t-att-checked (patching with same value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"checked\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let attr1 = new Boolean(ctx['v']);
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
@@ -824,12 +837,13 @@ exports[`special cases for some specific html attributes/properties input, type
|
||||
exports[`special cases for some specific html attributes/properties select with t-att-value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<select block-attribute-0=\\"value\\"><option value=\\"potato\\">Potato</option><option value=\\"tomato\\">Tomato</option><option value=\\"onion\\">Onion</option></select>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let attr1 = new String((ctx['value']) || \\"\\");
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
@@ -838,12 +852,13 @@ exports[`special cases for some specific html attributes/properties select with
|
||||
exports[`special cases for some specific html attributes/properties textarea with t-att-value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<textarea block-attribute-0=\\"value\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let attr1 = new String((ctx['v']) || \\"\\");
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
@@ -852,6 +867,7 @@ exports[`special cases for some specific html attributes/properties textarea wit
|
||||
exports[`special cases for some specific html attributes/properties various boolean html attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><input type=\\"checkbox\\" checked=\\"checked\\"/><input checked=\\"checked\\"/><div checked=\\"checked\\"/><div selected=\\"selected\\"/><option selected=\\"selected\\" other=\\"1\\"/><input readonly=\\"readonly\\"/><button disabled=\\"disabled\\"/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`comments only a comment 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -14,6 +15,7 @@ exports[`comments only a comment 1`] = `
|
||||
exports[`comments properly handle comments 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hello <!-- comment-->owl</div>\`);
|
||||
@@ -27,6 +29,7 @@ exports[`comments properly handle comments 1`] = `
|
||||
exports[`comments properly handle comments between t-if/t-else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-on can bind event handler 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`t-on can bind event handler 1`] = `
|
||||
exports[`t-on can bind handlers with arguments 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -32,6 +34,7 @@ exports[`t-on can bind handlers with arguments 1`] = `
|
||||
exports[`t-on can bind handlers with empty object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -47,6 +50,7 @@ exports[`t-on can bind handlers with empty object 1`] = `
|
||||
exports[`t-on can bind handlers with empty object (with non empty inner string) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -62,6 +66,7 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
|
||||
exports[`t-on can bind handlers with empty object (with non empty inner string) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -89,6 +94,7 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
|
||||
exports[`t-on can bind handlers with object arguments 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -104,6 +110,7 @@ exports[`t-on can bind handlers with object arguments 1`] = `
|
||||
exports[`t-on can bind two event handlers 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\" block-handler-1=\\"dblclick\\">Click</button>\`);
|
||||
@@ -119,6 +126,7 @@ exports[`t-on can bind two event handlers 1`] = `
|
||||
exports[`t-on handler is bound to proper owner 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -133,6 +141,7 @@ exports[`t-on handler is bound to proper owner 1`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -155,6 +164,7 @@ exports[`t-on handler is bound to proper owner, part 2 1`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -167,6 +177,7 @@ exports[`t-on handler is bound to proper owner, part 3 1`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 3 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -181,6 +192,7 @@ exports[`t-on handler is bound to proper owner, part 3 2`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 4 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -205,6 +217,7 @@ exports[`t-on handler is bound to proper owner, part 4 1`] = `
|
||||
exports[`t-on handler is bound to proper owner, part 4 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -219,6 +232,7 @@ exports[`t-on handler is bound to proper owner, part 4 2`] = `
|
||||
exports[`t-on receive event in first argument 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -233,6 +247,7 @@ exports[`t-on receive event in first argument 1`] = `
|
||||
exports[`t-on t-on modifiers (native listener) basic support for native listener 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"myClass\\" block-handler-0=\\"click\\"><button block-handler-1=\\"click\\">Button</button></div>\`);
|
||||
@@ -248,6 +263,7 @@ exports[`t-on t-on modifiers (native listener) basic support for native listener
|
||||
exports[`t-on t-on modifiers (native listener) t-on combined with t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><block-text-1/></button></div>\`);
|
||||
@@ -263,6 +279,7 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-esc 1`] = `
|
||||
exports[`t-on t-on modifiers (native listener) t-on combined with t-out 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -279,6 +296,7 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-out 1`] = `
|
||||
exports[`t-on t-on modifiers (native listener) t-on with .capture modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click.capture\\"><button block-handler-1=\\"click\\">Button</button></div>\`);
|
||||
@@ -294,6 +312,7 @@ exports[`t-on t-on modifiers (native listener) t-on with .capture modifier 1`] =
|
||||
exports[`t-on t-on modifiers (native listener) t-on with empty handler (only modifiers) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent\\">Button</button></div>\`);
|
||||
@@ -308,6 +327,7 @@ exports[`t-on t-on modifiers (native listener) t-on with empty handler (only mod
|
||||
exports[`t-on t-on modifiers (native listener) t-on with prevent and self modifiers (order matters) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent.self\\"><span>Button</span></button></div>\`);
|
||||
@@ -322,6 +342,7 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent and self modifi
|
||||
exports[`t-on t-on modifiers (native listener) t-on with prevent and/or stop modifiers 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent\\">Button 1</button><button block-handler-1=\\"click.stop\\">Button 2</button><button block-handler-2=\\"click.prevent.stop\\">Button 3</button></div>\`);
|
||||
@@ -338,6 +359,7 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent and/or stop mod
|
||||
exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -365,6 +387,7 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-f
|
||||
exports[`t-on t-on modifiers (native listener) t-on with self and prevent modifiers (order matters) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.self.prevent\\"><span>Button</span></button></div>\`);
|
||||
@@ -379,6 +402,7 @@ exports[`t-on t-on modifiers (native listener) t-on with self and prevent modifi
|
||||
exports[`t-on t-on modifiers (native listener) t-on with self modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><span>Button</span></button><button block-handler-1=\\"click.self\\"><span>Button</span></button></div>\`);
|
||||
@@ -394,6 +418,7 @@ exports[`t-on t-on modifiers (native listener) t-on with self modifier 1`] = `
|
||||
exports[`t-on t-on modifiers (synthetic listener) basic support for synthetic 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click.synthetic\\"><button block-handler-1=\\"click.synthetic\\">Button</button></div>\`);
|
||||
@@ -409,6 +434,7 @@ exports[`t-on t-on modifiers (synthetic listener) basic support for synthetic 1`
|
||||
exports[`t-on t-on with inline statement (function call) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -424,6 +450,7 @@ exports[`t-on t-on with inline statement (function call) 1`] = `
|
||||
exports[`t-on t-on with inline statement 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
@@ -439,6 +466,7 @@ exports[`t-on t-on with inline statement 1`] = `
|
||||
exports[`t-on t-on with inline statement, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Toggle</button>\`);
|
||||
@@ -454,6 +482,7 @@ exports[`t-on t-on with inline statement, part 2 1`] = `
|
||||
exports[`t-on t-on with inline statement, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Toggle</button>\`);
|
||||
@@ -470,6 +499,7 @@ exports[`t-on t-on with inline statement, part 3 1`] = `
|
||||
exports[`t-on t-on with t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -485,6 +515,7 @@ exports[`t-on t-on with t-call 1`] = `
|
||||
exports[`t-on t-on with t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
@@ -499,6 +530,7 @@ exports[`t-on t-on with t-call 2`] = `
|
||||
exports[`t-on t-on, with arguments and t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -514,6 +546,7 @@ exports[`t-on t-on, with arguments and t-call 1`] = `
|
||||
exports[`t-on t-on, with arguments and t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`misc complex template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`SlotButton\`, true, false, false, false);
|
||||
@@ -82,6 +83,7 @@ exports[`misc complex template 1`] = `
|
||||
exports[`misc global 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, zero, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`_callee-uses-foo\`);
|
||||
@@ -134,6 +136,7 @@ exports[`misc global 1`] = `
|
||||
exports[`misc global 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { withDefault } = helpers;
|
||||
|
||||
@@ -149,6 +152,7 @@ exports[`misc global 2`] = `
|
||||
exports[`misc global 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -165,14 +169,15 @@ exports[`misc global 3`] = `
|
||||
exports[`misc global 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
let { safeOutput, withDefault } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b3 = text(\`toto default\`);
|
||||
const b2 = safeOutput(ctx['toto'], b3);
|
||||
const b2 = withDefault(safeOutput(ctx['toto']), b3);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -181,6 +186,7 @@ exports[`misc global 4`] = `
|
||||
exports[`misc other complex template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`LOAD_INFOS_TEMPLATE\`);
|
||||
@@ -269,7 +275,7 @@ exports[`misc other complex template 1`] = `
|
||||
ctx[\`category\`] = v_block15[i1];
|
||||
const key1 = ctx['category'].id;
|
||||
let attr6 = ctx['category'].id;
|
||||
let attr7 = new Boolean(ctx['category'].id==ctx['options'].active_category_id);
|
||||
let attr7 = ctx['category'].id==ctx['options'].active_category_id;
|
||||
let txt5 = ctx['category'].name;
|
||||
c_block15[i1] = withKey(block16([attr6, attr7, txt5]), key1);
|
||||
}
|
||||
@@ -277,7 +283,7 @@ exports[`misc other complex template 1`] = `
|
||||
const b15 = list(c_block15);
|
||||
b14 = block14([], [b15]);
|
||||
}
|
||||
let attr8 = new String((ctx['search'].value) || \\"\\");
|
||||
let attr8 = ctx['search'].value;
|
||||
let hdlr4 = [ctx['updateFilter'], ctx];
|
||||
let hdlr5 = [ctx['updateFilter'], ctx];
|
||||
let hdlr6 = [ctx['clearSearch'], ctx];
|
||||
@@ -291,7 +297,7 @@ exports[`misc other complex template 1`] = `
|
||||
if (!ctx['trigger'].manual&&ctx['trigger'].project_id===ctx['project'].id&&ctx['trigger'].category_id===ctx['options'].active_category_id) {
|
||||
let attr9 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr10 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr11 = new Boolean(ctx['options'].trigger_display[ctx['trigger'].id]);
|
||||
let attr11 = ctx['options'].trigger_display[ctx['trigger'].id];
|
||||
let attr12 = ctx['trigger'].id;
|
||||
let hdlr7 = [ctx['updateTriggerDisplay'], ctx];
|
||||
let attr13 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`memory t-foreach does not leak stuff in global scope 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`simple templates, mostly static can render a table row 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<tr><td>cell</td></tr>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`simple templates, mostly static can render a table row 1`] = `
|
||||
exports[`simple templates, mostly static div with a class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"abc\\">foo</div>\`);
|
||||
@@ -29,6 +31,7 @@ exports[`simple templates, mostly static div with a class attribute 1`] = `
|
||||
exports[`simple templates, mostly static div with a class attribute with a quote 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"a'bc\\">word</div>\`);
|
||||
@@ -42,6 +45,7 @@ exports[`simple templates, mostly static div with a class attribute with a quote
|
||||
exports[`simple templates, mostly static div with a span child node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span>word</span></div>\`);
|
||||
@@ -55,6 +59,7 @@ exports[`simple templates, mostly static div with a span child node 1`] = `
|
||||
exports[`simple templates, mostly static div with an arbitrary attribute with a quote 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div abc=\\"a'bc\\">word</div>\`);
|
||||
@@ -68,6 +73,7 @@ exports[`simple templates, mostly static div with an arbitrary attribute with a
|
||||
exports[`simple templates, mostly static div with an empty class attribute 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>word</div>\`);
|
||||
@@ -81,6 +87,7 @@ exports[`simple templates, mostly static div with an empty class attribute 1`] =
|
||||
exports[`simple templates, mostly static div with content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>foo</div>\`);
|
||||
@@ -94,6 +101,7 @@ exports[`simple templates, mostly static div with content 1`] = `
|
||||
exports[`simple templates, mostly static dom node with t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -108,6 +116,7 @@ exports[`simple templates, mostly static dom node with t-esc 1`] = `
|
||||
exports[`simple templates, mostly static dom node with t-esc 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -122,6 +131,7 @@ exports[`simple templates, mostly static dom node with t-esc 2`] = `
|
||||
exports[`simple templates, mostly static dynamic text value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -133,6 +143,7 @@ exports[`simple templates, mostly static dynamic text value 1`] = `
|
||||
exports[`simple templates, mostly static empty div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -146,6 +157,7 @@ exports[`simple templates, mostly static empty div 1`] = `
|
||||
exports[`simple templates, mostly static empty string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -157,6 +169,7 @@ exports[`simple templates, mostly static empty string 1`] = `
|
||||
exports[`simple templates, mostly static empty string in a template set 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -168,6 +181,7 @@ exports[`simple templates, mostly static empty string in a template set 1`] = `
|
||||
exports[`simple templates, mostly static inline template string in t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -179,6 +193,7 @@ exports[`simple templates, mostly static inline template string in t-esc 1`] = `
|
||||
exports[`simple templates, mostly static inline template string with content in t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -194,6 +209,7 @@ exports[`simple templates, mostly static inline template string with content in
|
||||
exports[`simple templates, mostly static inline template string with variable in context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -205,6 +221,7 @@ exports[`simple templates, mostly static inline template string with variable in
|
||||
exports[`simple templates, mostly static multiple root nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div>foo</div>\`);
|
||||
@@ -221,6 +238,7 @@ exports[`simple templates, mostly static multiple root nodes 1`] = `
|
||||
exports[`simple templates, mostly static simple string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -232,6 +250,7 @@ exports[`simple templates, mostly static simple string 1`] = `
|
||||
exports[`simple templates, mostly static simple string in t tag 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -243,6 +262,7 @@ exports[`simple templates, mostly static simple string in t tag 1`] = `
|
||||
exports[`simple templates, mostly static static text and dynamic text (no t tag) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -256,6 +276,7 @@ exports[`simple templates, mostly static static text and dynamic text (no t tag)
|
||||
exports[`simple templates, mostly static static text and dynamic text 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -269,6 +290,7 @@ exports[`simple templates, mostly static static text and dynamic text 1`] = `
|
||||
exports[`simple templates, mostly static t-esc in dom node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -283,6 +305,7 @@ exports[`simple templates, mostly static t-esc in dom node 1`] = `
|
||||
exports[`simple templates, mostly static t-esc in dom node, variations 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hello <block-text-0/></div>\`);
|
||||
@@ -297,6 +320,7 @@ exports[`simple templates, mostly static t-esc in dom node, variations 1`] = `
|
||||
exports[`simple templates, mostly static t-esc in dom node, variations 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hello <block-text-0/> world</div>\`);
|
||||
@@ -311,6 +335,7 @@ exports[`simple templates, mostly static t-esc in dom node, variations 2`] = `
|
||||
exports[`simple templates, mostly static template with multiple t tag with multiple content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/>Loading<block-text-2/></div>\`);
|
||||
@@ -327,6 +352,7 @@ exports[`simple templates, mostly static template with multiple t tag with multi
|
||||
exports[`simple templates, mostly static template with t tag with multiple content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Loading<block-child-0/></div>\`);
|
||||
@@ -344,6 +370,7 @@ exports[`simple templates, mostly static template with t tag with multiple conte
|
||||
exports[`simple templates, mostly static two t-escs next to each other 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -357,6 +384,7 @@ exports[`simple templates, mostly static two t-escs next to each other 1`] = `
|
||||
exports[`simple templates, mostly static two t-escs next to each other 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -370,6 +398,7 @@ exports[`simple templates, mostly static two t-escs next to each other 2`] = `
|
||||
exports[`simple templates, mostly static two t-escs next to each other, in a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`properly support svg add proper namespace to g tags 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<g block-ns=\\"http://www.w3.org/2000/svg\\"><circle cx=\\"50\\" cy=\\"50\\" r=\\"4\\" stroke=\\"green\\" stroke-width=\\"1\\" fill=\\"yellow\\"/> </g>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`properly support svg add proper namespace to g tags 1`] = `
|
||||
exports[`properly support svg add proper namespace to svg 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\" width=\\"100px\\" height=\\"90px\\"><circle cx=\\"50\\" cy=\\"50\\" r=\\"4\\" stroke=\\"green\\" stroke-width=\\"1\\" fill=\\"yellow\\"/> </svg>\`);
|
||||
@@ -29,6 +31,7 @@ exports[`properly support svg add proper namespace to svg 1`] = `
|
||||
exports[`properly support svg namespace to g tags not added if already in svg namespace 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><g/></svg>\`);
|
||||
@@ -42,6 +45,7 @@ exports[`properly support svg namespace to g tags not added if already in svg na
|
||||
exports[`properly support svg namespace to svg tags added even if already in svg namespace 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><svg/></svg>\`);
|
||||
@@ -55,6 +59,7 @@ exports[`properly support svg namespace to svg tags added even if already in svg
|
||||
exports[`properly support svg svg creates new block if it is within html -- 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -75,6 +80,7 @@ exports[`properly support svg svg creates new block if it is within html -- 2 1`
|
||||
exports[`properly support svg svg creates new block if it is within html 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -90,6 +96,7 @@ exports[`properly support svg svg creates new block if it is within html 1`] = `
|
||||
exports[`properly support svg svg namespace added to sub templates if root tag is path 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`path\`);
|
||||
|
||||
@@ -105,6 +112,7 @@ exports[`properly support svg svg namespace added to sub templates if root tag i
|
||||
exports[`properly support svg svg namespace added to sub templates if root tag is path 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<path block-ns=\\"http://www.w3.org/2000/svg\\"/>\`);
|
||||
@@ -118,6 +126,7 @@ exports[`properly support svg svg namespace added to sub templates if root tag i
|
||||
exports[`properly support svg svg namespace added to sub-blocks 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><block-child-0/></svg>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-call (template calling) basic caller 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`_basic-callee\`);
|
||||
|
||||
@@ -18,6 +19,7 @@ exports[`t-call (template calling) basic caller 1`] = `
|
||||
exports[`t-call (template calling) basic caller 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>ok</span>\`);
|
||||
@@ -31,6 +33,7 @@ exports[`t-call (template calling) basic caller 2`] = `
|
||||
exports[`t-call (template calling) basic caller, no parent node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`_basic-callee\`);
|
||||
|
||||
@@ -43,6 +46,7 @@ exports[`t-call (template calling) basic caller, no parent node 1`] = `
|
||||
exports[`t-call (template calling) basic caller, no parent node 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>ok</span>\`);
|
||||
@@ -56,6 +60,7 @@ exports[`t-call (template calling) basic caller, no parent node 2`] = `
|
||||
exports[`t-call (template calling) call with several sub nodes on same line 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -81,6 +86,7 @@ exports[`t-call (template calling) call with several sub nodes on same line 1`]
|
||||
exports[`t-call (template calling) call with several sub nodes on same line 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -96,6 +102,7 @@ exports[`t-call (template calling) call with several sub nodes on same line 2`]
|
||||
exports[`t-call (template calling) cascading t-call t-out='0' 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`subTemplate\`);
|
||||
@@ -121,6 +128,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 1`] = `
|
||||
exports[`t-call (template calling) cascading t-call t-out='0' 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`subSubTemplate\`);
|
||||
@@ -144,6 +152,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 2`] = `
|
||||
exports[`t-call (template calling) cascading t-call t-out='0' 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`finalTemplate\`);
|
||||
@@ -167,6 +176,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 3`] = `
|
||||
exports[`t-call (template calling) cascading t-call t-out='0' 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -182,6 +192,7 @@ exports[`t-call (template calling) cascading t-call t-out='0' 4`] = `
|
||||
exports[`t-call (template calling) cascading t-call t-out='0', without external divs 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`subTemplate\`);
|
||||
@@ -205,6 +216,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
exports[`t-call (template calling) cascading t-call t-out='0', without external divs 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`subSubTemplate\`);
|
||||
@@ -226,6 +238,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
exports[`t-call (template calling) cascading t-call t-out='0', without external divs 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`finalTemplate\`);
|
||||
@@ -247,6 +260,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
exports[`t-call (template calling) cascading t-call t-out='0', without external divs 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -263,6 +277,7 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
|
||||
exports[`t-call (template calling) dynamic t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const call = app.callTemplate.bind(app);
|
||||
|
||||
@@ -279,6 +294,7 @@ exports[`t-call (template calling) dynamic t-call 1`] = `
|
||||
exports[`t-call (template calling) dynamic t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<foo><block-text-0/></foo>\`);
|
||||
@@ -293,6 +309,7 @@ exports[`t-call (template calling) dynamic t-call 2`] = `
|
||||
exports[`t-call (template calling) dynamic t-call 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<bar><block-text-0/></bar>\`);
|
||||
@@ -307,6 +324,7 @@ exports[`t-call (template calling) dynamic t-call 3`] = `
|
||||
exports[`t-call (template calling) inherit context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -326,6 +344,7 @@ exports[`t-call (template calling) inherit context 1`] = `
|
||||
exports[`t-call (template calling) inherit context 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -334,60 +353,10 @@ exports[`t-call (template calling) inherit context 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call (template calling) nested t-calls with magic variable 0 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`grandchild\`);
|
||||
const callTemplate_2 = app.getTemplate(\`child\`);
|
||||
|
||||
let block1 = createBlock(\`<p>Some content...</p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
const b1 = block1();
|
||||
ctx[zero] = b1;
|
||||
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
ctx[zero] = b2;
|
||||
return callTemplate_2.call(this, ctx, node, key + \`__2\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call (template calling) nested t-calls with magic variable 0 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`grandchild\`);
|
||||
const b3 = ctx[zero];
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call (template calling) nested t-calls with magic variable 0 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return ctx[zero];
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call (template calling) recursive template, part 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`recursive\`);
|
||||
|
||||
@@ -406,6 +375,7 @@ exports[`t-call (template calling) recursive template, part 1 1`] = `
|
||||
exports[`t-call (template calling) recursive template, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
|
||||
@@ -427,6 +397,7 @@ exports[`t-call (template calling) recursive template, part 2 1`] = `
|
||||
exports[`t-call (template calling) recursive template, part 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
|
||||
@@ -461,6 +432,7 @@ exports[`t-call (template calling) recursive template, part 2 2`] = `
|
||||
exports[`t-call (template calling) recursive template, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
|
||||
@@ -482,6 +454,7 @@ exports[`t-call (template calling) recursive template, part 3 1`] = `
|
||||
exports[`t-call (template calling) recursive template, part 3 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
|
||||
@@ -516,6 +489,7 @@ exports[`t-call (template calling) recursive template, part 3 2`] = `
|
||||
exports[`t-call (template calling) recursive template, part 4: with t-set recursive index 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
|
||||
@@ -538,6 +512,7 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
|
||||
exports[`t-call (template calling) recursive template, part 4: with t-set recursive index 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
|
||||
@@ -574,6 +549,7 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
|
||||
exports[`t-call (template calling) scoped parameters 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -597,6 +573,7 @@ exports[`t-call (template calling) scoped parameters 1`] = `
|
||||
exports[`t-call (template calling) scoped parameters 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -608,6 +585,7 @@ exports[`t-call (template calling) scoped parameters 2`] = `
|
||||
exports[`t-call (template calling) scoped parameters, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -632,6 +610,7 @@ exports[`t-call (template calling) scoped parameters, part 2 1`] = `
|
||||
exports[`t-call (template calling) scoped parameters, part 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -643,6 +622,7 @@ exports[`t-call (template calling) scoped parameters, part 2 2`] = `
|
||||
exports[`t-call (template calling) t-call allowed on a non t node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -658,6 +638,7 @@ exports[`t-call (template calling) t-call allowed on a non t node 1`] = `
|
||||
exports[`t-call (template calling) t-call allowed on a non t node 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>ok</span>\`);
|
||||
@@ -671,6 +652,7 @@ exports[`t-call (template calling) t-call allowed on a non t node 2`] = `
|
||||
exports[`t-call (template calling) t-call on a div with t-call-context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -687,6 +669,7 @@ exports[`t-call (template calling) t-call on a div with t-call-context 1`] = `
|
||||
exports[`t-call (template calling) t-call on a div with t-call-context 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -701,6 +684,7 @@ exports[`t-call (template calling) t-call on a div with t-call-context 2`] = `
|
||||
exports[`t-call (template calling) t-call with body content as root of a template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`antony\`);
|
||||
@@ -720,6 +704,7 @@ exports[`t-call (template calling) t-call with body content as root of a templat
|
||||
exports[`t-call (template calling) t-call with body content as root of a template 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -735,6 +720,7 @@ exports[`t-call (template calling) t-call with body content as root of a templat
|
||||
exports[`t-call (template calling) t-call with t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -753,6 +739,7 @@ exports[`t-call (template calling) t-call with t-if 1`] = `
|
||||
exports[`t-call (template calling) t-call with t-if 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>ok</span>\`);
|
||||
@@ -766,6 +753,7 @@ exports[`t-call (template calling) t-call with t-if 2`] = `
|
||||
exports[`t-call (template calling) t-call with t-set inside and body text content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -787,6 +775,7 @@ exports[`t-call (template calling) t-call with t-set inside and body text conten
|
||||
exports[`t-call (template calling) t-call with t-set inside and body text content 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
@@ -801,6 +790,7 @@ exports[`t-call (template calling) t-call with t-set inside and body text conten
|
||||
exports[`t-call (template calling) t-call with t-set inside and outside 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -835,6 +825,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside 1`] = `
|
||||
exports[`t-call (template calling) t-call with t-set inside and outside 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -849,6 +840,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside 2`] = `
|
||||
exports[`t-call (template calling) t-call with t-set inside and outside. 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`main\`);
|
||||
@@ -868,6 +860,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 1`] =
|
||||
exports[`t-call (template calling) t-call with t-set inside and outside. 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -902,6 +895,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 2`] =
|
||||
exports[`t-call (template calling) t-call with t-set inside and outside. 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -918,6 +912,7 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 3`] =
|
||||
exports[`t-call (template calling) t-call, conditional and t-set in t-call body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`callee1\`);
|
||||
@@ -947,6 +942,7 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
|
||||
exports[`t-call (template calling) t-call, conditional and t-set in t-call body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>callee1</div>\`);
|
||||
@@ -960,6 +956,7 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
|
||||
exports[`t-call (template calling) t-call, conditional and t-set in t-call body 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>callee2 <block-text-0/></div>\`);
|
||||
@@ -974,6 +971,7 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
|
||||
exports[`t-call (template calling) t-call-context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -987,6 +985,7 @@ exports[`t-call (template calling) t-call-context 1`] = `
|
||||
exports[`t-call (template calling) t-call-context 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -1001,6 +1000,7 @@ exports[`t-call (template calling) t-call-context 2`] = `
|
||||
exports[`t-call (template calling) t-call-context and value in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -1020,6 +1020,7 @@ exports[`t-call (template calling) t-call-context and value in body 1`] = `
|
||||
exports[`t-call (template calling) t-call-context and value in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
@@ -1035,6 +1036,7 @@ exports[`t-call (template calling) t-call-context and value in body 2`] = `
|
||||
exports[`t-call (template calling) t-esc inside t-call, with t-set outside 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -1054,6 +1056,7 @@ exports[`t-call (template calling) t-esc inside t-call, with t-set outside 1`] =
|
||||
exports[`t-call (template calling) t-esc inside t-call, with t-set outside 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -1068,6 +1071,7 @@ exports[`t-call (template calling) t-esc inside t-call, with t-set outside 2`] =
|
||||
exports[`t-call (template calling) with unused body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -1085,6 +1089,7 @@ exports[`t-call (template calling) with unused body 1`] = `
|
||||
exports[`t-call (template calling) with unused body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>ok</div>\`);
|
||||
@@ -1098,6 +1103,7 @@ exports[`t-call (template calling) with unused body 2`] = `
|
||||
exports[`t-call (template calling) with unused setbody 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -1116,6 +1122,7 @@ exports[`t-call (template calling) with unused setbody 1`] = `
|
||||
exports[`t-call (template calling) with unused setbody 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>ok</div>\`);
|
||||
@@ -1129,6 +1136,7 @@ exports[`t-call (template calling) with unused setbody 2`] = `
|
||||
exports[`t-call (template calling) with used body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -1146,6 +1154,7 @@ exports[`t-call (template calling) with used body 1`] = `
|
||||
exports[`t-call (template calling) with used body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -1161,6 +1170,7 @@ exports[`t-call (template calling) with used body 2`] = `
|
||||
exports[`t-call (template calling) with used setbody 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -1182,6 +1192,7 @@ exports[`t-call (template calling) with used setbody 1`] = `
|
||||
exports[`t-call (template calling) with used setbody 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`debugging t-debug 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -23,6 +24,7 @@ exports[`debugging t-debug 1`] = `
|
||||
exports[`debugging t-debug on sub template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p>coucou</p>\`);
|
||||
@@ -37,6 +39,7 @@ exports[`debugging t-debug on sub template 1`] = `
|
||||
exports[`debugging t-debug on sub template 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -52,6 +55,7 @@ exports[`debugging t-debug on sub template 2`] = `
|
||||
exports[`debugging t-log 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-esc div with falsy values 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><p><block-text-1/></p><p><block-text-2/></p><p><block-text-3/></p><p><block-text-4/></p></div>\`);
|
||||
@@ -21,6 +22,7 @@ exports[`t-esc div with falsy values 1`] = `
|
||||
exports[`t-esc escaping 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -35,6 +37,7 @@ exports[`t-esc escaping 1`] = `
|
||||
exports[`t-esc escaping on a node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -49,6 +52,7 @@ exports[`t-esc escaping on a node 1`] = `
|
||||
exports[`t-esc escaping on a node with a body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { withDefault } = helpers;
|
||||
|
||||
@@ -64,6 +68,7 @@ exports[`t-esc escaping on a node with a body 1`] = `
|
||||
exports[`t-esc escaping on a node with a body, as a default 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { withDefault } = helpers;
|
||||
|
||||
@@ -79,6 +84,7 @@ exports[`t-esc escaping on a node with a body, as a default 1`] = `
|
||||
exports[`t-esc falsy values in text nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -99,6 +105,7 @@ exports[`t-esc falsy values in text nodes 1`] = `
|
||||
exports[`t-esc literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -113,6 +120,7 @@ exports[`t-esc literal 1`] = `
|
||||
exports[`t-esc t-esc is escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
@@ -126,32 +134,7 @@ exports[`t-esc t-esc is escaped 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`var\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
let txt1 = ctx['var'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc t-esc with the 0 number 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['var']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc t-esc with the 0 number, in a p 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx[\`var\`] = new LazyValue(value1, ctx, this, node);
|
||||
let txt1 = ctx['var'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
@@ -161,6 +144,7 @@ exports[`t-esc t-esc with the 0 number, in a p 1`] = `
|
||||
exports[`t-esc t-esc work with spread operator 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -175,6 +159,7 @@ exports[`t-esc t-esc work with spread operator 1`] = `
|
||||
exports[`t-esc t-esc=0 is escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -196,6 +181,7 @@ exports[`t-esc t-esc=0 is escaped 1`] = `
|
||||
exports[`t-esc t-esc=0 is escaped 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -208,20 +194,10 @@ exports[`t-esc t-esc=0 is escaped 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc top level t-esc with undefined 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['var']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-esc variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-foreach does not pollute the rendering context 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -25,6 +26,7 @@ exports[`t-foreach does not pollute the rendering context 1`] = `
|
||||
exports[`t-foreach iterate on items (on a element node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -49,6 +51,7 @@ exports[`t-foreach iterate on items (on a element node) 1`] = `
|
||||
exports[`t-foreach iterate on items 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -80,6 +83,7 @@ exports[`t-foreach iterate on items 1`] = `
|
||||
exports[`t-foreach iterate, dict param 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -111,6 +115,7 @@ exports[`t-foreach iterate, dict param 1`] = `
|
||||
exports[`t-foreach iterate, position 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -147,6 +152,7 @@ exports[`t-foreach iterate, position 1`] = `
|
||||
exports[`t-foreach simple iteration (in a node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -169,6 +175,7 @@ exports[`t-foreach simple iteration (in a node) 1`] = `
|
||||
exports[`t-foreach simple iteration 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -188,6 +195,7 @@ exports[`t-foreach simple iteration 1`] = `
|
||||
exports[`t-foreach simple iteration with two nodes inside 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -214,6 +222,7 @@ exports[`t-foreach simple iteration with two nodes inside 1`] = `
|
||||
exports[`t-foreach t-call with body in t-foreach in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -267,6 +276,7 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 1`] = `
|
||||
exports[`t-foreach t-call with body in t-foreach in t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -285,6 +295,7 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 2`] = `
|
||||
exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -332,6 +343,7 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
|
||||
exports[`t-foreach t-call without body in t-foreach in t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -354,6 +366,7 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 2`] = `
|
||||
exports[`t-foreach t-foreach in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -388,6 +401,7 @@ exports[`t-foreach t-foreach in t-foreach 1`] = `
|
||||
exports[`t-foreach t-foreach with t-if inside (no external node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -414,6 +428,7 @@ exports[`t-foreach t-foreach with t-if inside (no external node) 1`] = `
|
||||
exports[`t-foreach t-foreach with t-if inside 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -442,6 +457,7 @@ exports[`t-foreach t-foreach with t-if inside 1`] = `
|
||||
exports[`t-foreach t-key on t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -465,6 +481,7 @@ exports[`t-foreach t-key on t-foreach 1`] = `
|
||||
exports[`t-foreach throws error if invalid loop expression 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -490,6 +507,7 @@ exports[`t-foreach throws error if invalid loop expression 1`] = `
|
||||
exports[`t-foreach with t-memo 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-if a t-if next to a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div>foo</div>\`);
|
||||
@@ -21,6 +22,7 @@ exports[`t-if a t-if next to a div 1`] = `
|
||||
exports[`t-if a t-if with two inner nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<span>yip</span>\`);
|
||||
@@ -41,6 +43,7 @@ exports[`t-if a t-if with two inner nodes 1`] = `
|
||||
exports[`t-if boolean value condition elif (no outside node) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -62,6 +65,7 @@ exports[`t-if boolean value condition elif (no outside node) 1`] = `
|
||||
exports[`t-if boolean value condition elif 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-2/><block-child-3/></div>\`);
|
||||
@@ -85,6 +89,7 @@ exports[`t-if boolean value condition elif 1`] = `
|
||||
exports[`t-if boolean value condition else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span>begin</span><block-child-0/><block-child-1/><span>end</span></div>\`);
|
||||
@@ -104,6 +109,7 @@ exports[`t-if boolean value condition else 1`] = `
|
||||
exports[`t-if boolean value condition false else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span>begin</span><block-child-0/><block-child-1/><span>end</span></div>\`);
|
||||
@@ -123,6 +129,7 @@ exports[`t-if boolean value condition false else 1`] = `
|
||||
exports[`t-if boolean value condition missing 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
@@ -140,6 +147,7 @@ exports[`t-if boolean value condition missing 1`] = `
|
||||
exports[`t-if can use some boolean operators in expressions 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-2/><block-child-3/><block-child-4/><block-child-5/><block-child-6/><block-child-7/></div>\`);
|
||||
@@ -178,6 +186,7 @@ exports[`t-if can use some boolean operators in expressions 1`] = `
|
||||
exports[`t-if div containing a t-if with two inner nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -199,6 +208,7 @@ exports[`t-if div containing a t-if with two inner nodes 1`] = `
|
||||
exports[`t-if dynamic content after t-if with two children nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
||||
@@ -221,6 +231,7 @@ exports[`t-if dynamic content after t-if with two children nodes 1`] = `
|
||||
exports[`t-if just a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -236,6 +247,7 @@ exports[`t-if just a t-if 1`] = `
|
||||
exports[`t-if simple t-if/t-else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -253,6 +265,7 @@ exports[`t-if simple t-if/t-else 1`] = `
|
||||
exports[`t-if simple t-if/t-else in a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -272,6 +285,7 @@ exports[`t-if simple t-if/t-else in a div 1`] = `
|
||||
exports[`t-if t-esc with t-elif 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -291,6 +305,7 @@ exports[`t-if t-esc with t-elif 1`] = `
|
||||
exports[`t-if t-esc with t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -308,6 +323,7 @@ exports[`t-if t-esc with t-if 1`] = `
|
||||
exports[`t-if t-if and t-else with two nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block4 = createBlock(\`<span>a</span>\`);
|
||||
@@ -330,6 +346,7 @@ exports[`t-if t-if and t-else with two nodes 1`] = `
|
||||
exports[`t-if t-if in a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -347,6 +364,7 @@ exports[`t-if t-if in a div 1`] = `
|
||||
exports[`t-if t-if in a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -369,6 +387,7 @@ exports[`t-if t-if in a t-if 1`] = `
|
||||
exports[`t-if t-if with empty content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -385,6 +404,7 @@ exports[`t-if t-if with empty content 1`] = `
|
||||
exports[`t-if t-if/t-else with more content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -404,6 +424,7 @@ exports[`t-if t-if/t-else with more content 1`] = `
|
||||
exports[`t-if t-set, then t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -425,6 +446,7 @@ exports[`t-if t-set, then t-if 1`] = `
|
||||
exports[`t-if t-set, then t-if, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -448,6 +470,7 @@ exports[`t-if t-set, then t-if, part 2 1`] = `
|
||||
exports[`t-if t-set, then t-if, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -474,6 +497,7 @@ exports[`t-if t-set, then t-if, part 3 1`] = `
|
||||
exports[`t-if two consecutive t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -492,6 +516,7 @@ exports[`t-if two consecutive t-if 1`] = `
|
||||
exports[`t-if two consecutive t-if in a div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -512,6 +537,7 @@ exports[`t-if two consecutive t-if in a div 1`] = `
|
||||
exports[`t-if two t-ifs next to each other 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-key can use t-key directive on a node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -18,6 +19,7 @@ exports[`t-key can use t-key directive on a node 1`] = `
|
||||
exports[`t-key can use t-key directive on a node 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -33,6 +35,7 @@ exports[`t-key can use t-key directive on a node 2 1`] = `
|
||||
exports[`t-key can use t-key directive on a node as a function 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -48,6 +51,7 @@ exports[`t-key can use t-key directive on a node as a function 1`] = `
|
||||
exports[`t-key t-key directive in a list 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -72,6 +76,7 @@ exports[`t-key t-key directive in a list 1`] = `
|
||||
exports[`t-key t-key on sub dom node pushes a child block in its parent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -93,6 +98,7 @@ exports[`t-key t-key on sub dom node pushes a child block in its parent 1`] = `
|
||||
exports[`t-key t-key on sub dom node pushes a child block in its parent 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><h1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-out literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -18,6 +19,7 @@ exports[`t-out literal 1`] = `
|
||||
exports[`t-out literal, no outside html element 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -30,6 +32,7 @@ exports[`t-out literal, no outside html element 1`] = `
|
||||
exports[`t-out multiple calls to t-out 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -51,6 +54,7 @@ exports[`t-out multiple calls to t-out 1`] = `
|
||||
exports[`t-out multiple calls to t-out 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -67,6 +71,7 @@ exports[`t-out multiple calls to t-out 2`] = `
|
||||
exports[`t-out not escaping 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -82,6 +87,7 @@ exports[`t-out not escaping 1`] = `
|
||||
exports[`t-out number literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -97,6 +103,7 @@ exports[`t-out number literal 1`] = `
|
||||
exports[`t-out t-out 0 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`_basic-callee\`);
|
||||
@@ -118,6 +125,7 @@ exports[`t-out t-out 0 1`] = `
|
||||
exports[`t-out t-out 0 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { zero } = helpers;
|
||||
|
||||
@@ -133,6 +141,7 @@ exports[`t-out t-out 0 2`] = `
|
||||
exports[`t-out t-out and another sibling node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -148,6 +157,7 @@ exports[`t-out t-out and another sibling node 1`] = `
|
||||
exports[`t-out t-out bdom 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
|
||||
|
||||
@@ -161,7 +171,7 @@ exports[`t-out t-out bdom 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`var\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`var\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b3 = safeOutput(ctx['var']);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
@@ -171,6 +181,7 @@ exports[`t-out t-out bdom 1`] = `
|
||||
exports[`t-out t-out block 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -186,6 +197,7 @@ exports[`t-out t-out block 1`] = `
|
||||
exports[`t-out t-out escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -201,6 +213,7 @@ exports[`t-out t-out escaped 1`] = `
|
||||
exports[`t-out t-out markedup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -216,14 +229,15 @@ exports[`t-out t-out markedup 1`] = `
|
||||
exports[`t-out t-out on a node with a body, as a default 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
let { safeOutput, withDefault } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b3 = text(\`nope\`);
|
||||
const b2 = safeOutput(ctx['var'], b3);
|
||||
const b2 = withDefault(safeOutput(ctx['var']), b3);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -232,15 +246,16 @@ exports[`t-out t-out on a node with a body, as a default 1`] = `
|
||||
exports[`t-out t-out on a node with a dom node in body, as a default 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
let { safeOutput, withDefault } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
let block3 = createBlock(\`<div>nope</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b3 = block3();
|
||||
const b2 = safeOutput(ctx['var'], b3);
|
||||
const b2 = withDefault(safeOutput(ctx['var']), b3);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
@@ -249,6 +264,7 @@ exports[`t-out t-out on a node with a dom node in body, as a default 1`] = `
|
||||
exports[`t-out t-out switch escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -264,6 +280,7 @@ exports[`t-out t-out switch escaped 1`] = `
|
||||
exports[`t-out t-out switch escaped on markup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -279,6 +296,7 @@ exports[`t-out t-out switch escaped on markup 1`] = `
|
||||
exports[`t-out t-out switch markup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -294,6 +312,7 @@ exports[`t-out t-out switch markup 1`] = `
|
||||
exports[`t-out t-out switch markup on bdom 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
|
||||
|
||||
@@ -310,7 +329,7 @@ exports[`t-out t-out switch markup on bdom 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let b3,b5;
|
||||
ctx[\`bdom\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`bdom\`] = new LazyValue(value1, ctx, this, node);
|
||||
if (ctx['hasBdom']) {
|
||||
const b4 = safeOutput(ctx['bdom']);
|
||||
b3 = block3([], [b4]);
|
||||
@@ -326,6 +345,7 @@ exports[`t-out t-out switch markup on bdom 1`] = `
|
||||
exports[`t-out t-out switch markup on escaped 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -341,6 +361,7 @@ exports[`t-out t-out switch markup on escaped 1`] = `
|
||||
exports[`t-out t-out with a <t/> in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -353,6 +374,7 @@ exports[`t-out t-out with a <t/> in body 1`] = `
|
||||
exports[`t-out t-out with arbitrary object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -368,6 +390,7 @@ exports[`t-out t-out with arbitrary object 1`] = `
|
||||
exports[`t-out t-out with arbitrary object 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -383,6 +406,7 @@ exports[`t-out t-out with arbitrary object 2 1`] = `
|
||||
exports[`t-out t-out with comment 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -398,45 +422,7 @@ exports[`t-out t-out with comment 1`] = `
|
||||
exports[`t-out t-out with just a t-set t-value in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return safeOutput(ctx['var']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-out t-out with the 0 number 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return safeOutput(ctx['var']);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-out t-out with the 0 number, in a p 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<p><block-child-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = safeOutput(ctx['var']);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-out top level t-out with undefined 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -449,6 +435,7 @@ exports[`t-out top level t-out with undefined 1`] = `
|
||||
exports[`t-out variable 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -464,6 +451,7 @@ exports[`t-out variable 1`] = `
|
||||
exports[`t-out with a String class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -479,6 +467,7 @@ exports[`t-out with a String class 1`] = `
|
||||
exports[`t-out with an extended String class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -494,6 +483,7 @@ exports[`t-out with an extended String class 1`] = `
|
||||
exports[`t-raw is deprecated should warn 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -509,6 +499,7 @@ exports[`t-raw is deprecated should warn 1`] = `
|
||||
exports[`t-raw is deprecated t-out is actually called in t-raw's place 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-ref can get a dynamic ref on a node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
|
||||
@@ -19,6 +20,7 @@ exports[`t-ref can get a dynamic ref on a node 1`] = `
|
||||
exports[`t-ref can get a dynamic ref on a node, alternate syntax 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
|
||||
@@ -35,6 +37,7 @@ exports[`t-ref can get a dynamic ref on a node, alternate syntax 1`] = `
|
||||
exports[`t-ref can get a ref on a node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
|
||||
@@ -50,6 +53,7 @@ exports[`t-ref can get a ref on a node 1`] = `
|
||||
exports[`t-ref ref in a t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
|
||||
@@ -65,6 +69,7 @@ exports[`t-ref ref in a t-call 1`] = `
|
||||
exports[`t-ref ref in a t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>1<span block-ref=\\"0\\"/>2</div>\`);
|
||||
@@ -80,6 +85,7 @@ exports[`t-ref ref in a t-call 2`] = `
|
||||
exports[`t-ref ref in a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -100,6 +106,7 @@ exports[`t-ref ref in a t-if 1`] = `
|
||||
exports[`t-ref refs in a loop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -128,6 +135,7 @@ exports[`t-ref refs in a loop 1`] = `
|
||||
exports[`t-ref two refs, one in a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><p block-ref=\\"0\\"/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-set evaluate value expression 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -21,6 +22,7 @@ exports[`t-set evaluate value expression 1`] = `
|
||||
exports[`t-set evaluate value expression, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -39,6 +41,7 @@ exports[`t-set evaluate value expression, part 2 1`] = `
|
||||
exports[`t-set set from attribute literal (no outside div) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -54,6 +57,7 @@ exports[`t-set set from attribute literal (no outside div) 1`] = `
|
||||
exports[`t-set set from attribute literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -72,6 +76,7 @@ exports[`t-set set from attribute literal 1`] = `
|
||||
exports[`t-set set from attribute lookup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -90,6 +95,7 @@ exports[`t-set set from attribute lookup 1`] = `
|
||||
exports[`t-set set from body literal (with t-if/t-else 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
@@ -106,7 +112,7 @@ exports[`t-set set from body literal (with t-if/t-else 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`value\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`value\`] = new LazyValue(value1, ctx, this, node);
|
||||
return text(ctx['value']);
|
||||
}
|
||||
}"
|
||||
@@ -115,6 +121,7 @@ exports[`t-set set from body literal (with t-if/t-else 1`] = `
|
||||
exports[`t-set set from body literal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -130,6 +137,7 @@ exports[`t-set set from body literal 1`] = `
|
||||
exports[`t-set set from body lookup 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
@@ -142,7 +150,7 @@ exports[`t-set set from body lookup 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`stuff\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`stuff\`] = new LazyValue(value1, ctx, this, node);
|
||||
let txt1 = ctx['stuff'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
@@ -152,6 +160,7 @@ exports[`t-set set from body lookup 1`] = `
|
||||
exports[`t-set set from empty body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -170,6 +179,7 @@ exports[`t-set set from empty body 1`] = `
|
||||
exports[`t-set t-set and t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -191,6 +201,7 @@ exports[`t-set t-set and t-if 1`] = `
|
||||
exports[`t-set t-set body is evaluated immediately 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
|
||||
|
||||
@@ -206,7 +217,7 @@ exports[`t-set t-set body is evaluated immediately 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
ctx[\`v2\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`v2\`] = new LazyValue(value1, ctx, this, node);
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
const b3 = safeOutput(ctx['v2']);
|
||||
return block1([], [b3]);
|
||||
@@ -217,6 +228,7 @@ exports[`t-set t-set body is evaluated immediately 1`] = `
|
||||
exports[`t-set t-set can't alter from within callee 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -238,6 +250,7 @@ exports[`t-set t-set can't alter from within callee 1`] = `
|
||||
exports[`t-set t-set can't alter from within callee 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -257,6 +270,7 @@ exports[`t-set t-set can't alter from within callee 2`] = `
|
||||
exports[`t-set t-set can't alter in t-call body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
@@ -282,6 +296,7 @@ exports[`t-set t-set can't alter in t-call body 1`] = `
|
||||
exports[`t-set t-set can't alter in t-call body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -301,6 +316,7 @@ exports[`t-set t-set can't alter in t-call body 2`] = `
|
||||
exports[`t-set t-set does not modify render context existing key values 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -319,6 +335,7 @@ exports[`t-set t-set does not modify render context existing key values 1`] = `
|
||||
exports[`t-set t-set evaluates an expression only once 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -338,6 +355,7 @@ exports[`t-set t-set evaluates an expression only once 1`] = `
|
||||
exports[`t-set t-set outside modified in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
@@ -368,6 +386,7 @@ exports[`t-set t-set outside modified in t-foreach 1`] = `
|
||||
exports[`t-set t-set outside modified in t-foreach increment-after operator 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
@@ -398,6 +417,7 @@ exports[`t-set t-set outside modified in t-foreach increment-after operator 1`]
|
||||
exports[`t-set t-set outside modified in t-foreach increment-before operator 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
@@ -428,6 +448,7 @@ exports[`t-set t-set outside modified in t-foreach increment-before operator 1`]
|
||||
exports[`t-set t-set should reuse variable if possible 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
@@ -457,6 +478,7 @@ exports[`t-set t-set should reuse variable if possible 1`] = `
|
||||
exports[`t-set t-set with content and sub t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
@@ -471,7 +493,7 @@ exports[`t-set t-set with content and sub t-esc 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`setvar\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`setvar\`] = new LazyValue(value1, ctx, this, node);
|
||||
let txt1 = ctx['setvar'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
@@ -481,6 +503,7 @@ exports[`t-set t-set with content and sub t-esc 1`] = `
|
||||
exports[`t-set t-set with t-value (falsy) and body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
|
||||
|
||||
@@ -497,7 +520,7 @@ exports[`t-set t-set with t-value (falsy) and body 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"v3\\", false);
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, this, node, key));
|
||||
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, this, node));
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
setContextValue(ctx, \\"v3\\", true);
|
||||
const b3 = safeOutput(ctx['v2']);
|
||||
@@ -509,6 +532,7 @@ exports[`t-set t-set with t-value (falsy) and body 1`] = `
|
||||
exports[`t-set t-set with t-value (truthy) and body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
|
||||
|
||||
@@ -525,7 +549,7 @@ exports[`t-set t-set with t-value (truthy) and body 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"v3\\", 'Truthy');
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, this, node, key));
|
||||
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, this, node));
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
setContextValue(ctx, \\"v3\\", false);
|
||||
const b3 = safeOutput(ctx['v2']);
|
||||
@@ -534,36 +558,14 @@ exports[`t-set t-set with t-value (truthy) and body 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-set t-set, multiple t-ifs, and a specific configuration 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<p><div><span>First div</span></div><div><block-child-0/></div></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let b2;
|
||||
if (ctx['flag']) {
|
||||
setContextValue(ctx, \\"bouh\\", 2);
|
||||
}
|
||||
if (!ctx['flag']) {
|
||||
b2 = text(\`Second\`);
|
||||
}
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -582,10 +584,11 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = `
|
||||
exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -604,6 +607,7 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = `
|
||||
exports[`t-set t-set, t-if, and mix of expression/body lookup, 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -625,6 +629,7 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 3 1`] = `
|
||||
exports[`t-set value priority (with non text body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
|
||||
@@ -638,7 +643,7 @@ exports[`t-set value priority (with non text body 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`value\`] = withDefault(1, new LazyValue(value1, ctx, this, node, key));
|
||||
ctx[\`value\`] = withDefault(1, new LazyValue(value1, ctx, this, node));
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
@@ -648,6 +653,7 @@ exports[`t-set value priority (with non text body 1`] = `
|
||||
exports[`t-set value priority 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`qweb t-tag can fallback if falsy tag 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 'fallback'}/>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`qweb t-tag can fallback if falsy tag 1`] = `
|
||||
exports[`qweb t-tag can update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}/>\`);
|
||||
@@ -31,6 +33,7 @@ exports[`qweb t-tag can update 1`] = `
|
||||
exports[`qweb t-tag simple usecases 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}/>\`);
|
||||
@@ -45,6 +48,7 @@ exports[`qweb t-tag simple usecases 1`] = `
|
||||
exports[`qweb t-tag simple usecases 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}>text</\${tag || 't'}>\`);
|
||||
@@ -59,6 +63,7 @@ exports[`qweb t-tag simple usecases 2`] = `
|
||||
exports[`qweb t-tag with multiple attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'} class=\\"blueberry\\" taste=\\"raspberry\\">gooseberry</\${tag || 't'}>\`);
|
||||
@@ -73,6 +78,7 @@ exports[`qweb t-tag with multiple attributes 1`] = `
|
||||
exports[`qweb t-tag with multiple child nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}> pear <span>apple</span> strawberry </\${tag || 't'}>\`);
|
||||
@@ -87,6 +93,7 @@ exports[`qweb t-tag with multiple child nodes 1`] = `
|
||||
exports[`qweb t-tag with multiple t-tag in same template 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = tag => createBlock(\`<\${tag || 't'}><block-child-0/></\${tag || 't'}>\`);
|
||||
@@ -104,6 +111,7 @@ exports[`qweb t-tag with multiple t-tag in same template 1`] = `
|
||||
exports[`qweb t-tag with multiple t-tag in same template, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = tag => createBlock(\`<\${tag || 't'}>bar</\${tag || 't'}>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`loading templates addTemplates does not modify its xml document in place 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`loading templates addTemplates does not modify its xml document in plac
|
||||
exports[`loading templates can initialize qweb with a string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>jupiler</div>\`);
|
||||
@@ -30,6 +32,7 @@ exports[`loading templates can initialize qweb with a string 1`] = `
|
||||
exports[`loading templates can initialize qweb with an XMLDocument 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>jupiler</div>\`);
|
||||
@@ -43,6 +46,7 @@ exports[`loading templates can initialize qweb with an XMLDocument 1`] = `
|
||||
exports[`loading templates can load a few templates from a xml string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`items\`);
|
||||
|
||||
@@ -58,6 +62,7 @@ exports[`loading templates can load a few templates from a xml string 1`] = `
|
||||
exports[`loading templates can load a few templates from a xml string 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<li>ok</li>\`);
|
||||
@@ -74,6 +79,7 @@ exports[`loading templates can load a few templates from a xml string 2`] = `
|
||||
exports[`loading templates can load a few templates from an XMLDocument 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`items\`);
|
||||
|
||||
@@ -89,6 +95,7 @@ exports[`loading templates can load a few templates from an XMLDocument 1`] = `
|
||||
exports[`loading templates can load a few templates from an XMLDocument 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<li>ok</li>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`translation support can set and remove translatable attributes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div tomato=\\"word\\" potato=\\"mot\\" title=\\"mot\\" label=\\"word\\">text</div>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`translation support can set and remove translatable attributes 1`] = `
|
||||
exports[`translation support can translate node content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>mot</div>\`);
|
||||
@@ -29,6 +31,7 @@ exports[`translation support can translate node content 1`] = `
|
||||
exports[`translation support does not translate node content if disabled 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span>mot</span><span>word</span></div>\`);
|
||||
@@ -42,6 +45,7 @@ exports[`translation support does not translate node content if disabled 1`] = `
|
||||
exports[`translation support some attributes are translated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><p label=\\"mot\\">mot</p><p title=\\"mot\\">mot</p><p placeholder=\\"mot\\">mot</p><p alt=\\"mot\\">mot</p><p something=\\"word\\">mot</p></div>\`);
|
||||
@@ -55,6 +59,7 @@ exports[`translation support some attributes are translated 1`] = `
|
||||
exports[`translation support translation is done on the trimmed text, with extra spaces readded after 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div> mot </div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`white space handling consecutives whitespaces are condensed into a single space 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div> abc </div>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`white space handling consecutives whitespaces are condensed into a sing
|
||||
exports[`white space handling nothing is done in pre tags 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<pre> </pre>\`);
|
||||
@@ -29,6 +31,7 @@ exports[`white space handling nothing is done in pre tags 1`] = `
|
||||
exports[`white space handling nothing is done in pre tags 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<pre>
|
||||
@@ -44,6 +47,7 @@ exports[`white space handling nothing is done in pre tags 2`] = `
|
||||
exports[`white space handling nothing is done in pre tags 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<pre>
|
||||
@@ -59,6 +63,7 @@ exports[`white space handling nothing is done in pre tags 3`] = `
|
||||
exports[`white space handling pre inside a div with a new line 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><pre>SomeText</pre></div>\`);
|
||||
@@ -72,6 +77,7 @@ exports[`white space handling pre inside a div with a new line 1`] = `
|
||||
exports[`white space handling white space only text nodes are condensed into a single space 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div> </div>\`);
|
||||
@@ -85,6 +91,7 @@ exports[`white space handling white space only text nodes are condensed into a s
|
||||
exports[`white space handling whitespace only text nodes with newlines are removed 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><span>abc</span></div>\`);
|
||||
|
||||
@@ -329,35 +329,6 @@ describe("attributes", () => {
|
||||
expect(fixture.innerHTML).toBe('<div value=""></div>');
|
||||
});
|
||||
|
||||
test("updating property with falsy value", async () => {
|
||||
// render input with initial value
|
||||
const template = `<input t-att-value="v"></input>`;
|
||||
const bnode1 = renderToBdom(template, { v: false });
|
||||
const fixture = makeTestFixture();
|
||||
mount(bnode1, fixture);
|
||||
|
||||
const input = fixture.querySelector("input")!;
|
||||
expect(input.value).toBe("");
|
||||
|
||||
patch(bnode1, renderToBdom(template, { v: "owl" }));
|
||||
expect(input.value).toBe("owl");
|
||||
|
||||
patch(bnode1, renderToBdom(template, { v: false }));
|
||||
expect(input.value).toBe("");
|
||||
|
||||
patch(bnode1, renderToBdom(template, { v: "owl" }));
|
||||
expect(input.value).toBe("owl");
|
||||
|
||||
patch(bnode1, renderToBdom(template, { v: undefined }));
|
||||
expect(input.value).toBe("");
|
||||
|
||||
patch(bnode1, renderToBdom(template, { v: "owl" }));
|
||||
expect(input.value).toBe("owl");
|
||||
|
||||
patch(bnode1, renderToBdom(template, { v: null }));
|
||||
expect(input.value).toBe("");
|
||||
});
|
||||
|
||||
test("changing a class with t-att-class", () => {
|
||||
// render input with initial value
|
||||
const template = `<div t-att-class="v"/>`;
|
||||
@@ -458,42 +429,6 @@ describe("special cases for some specific html attributes/properties", () => {
|
||||
expect(input.value).toBe("potato");
|
||||
});
|
||||
|
||||
test("input with t-att-value (patching with same value", () => {
|
||||
// render input with initial value
|
||||
const template = `<input t-att-value="v"/>`;
|
||||
const bnode1 = renderToBdom(template, { v: "zucchini" });
|
||||
const fixture = makeTestFixture();
|
||||
mount(bnode1, fixture);
|
||||
const input = fixture.querySelector("input")!;
|
||||
expect(input.value).toBe("zucchini");
|
||||
|
||||
// change value manually in input, to simulate user input
|
||||
input.value = "tomato";
|
||||
expect(input.value).toBe("tomato");
|
||||
|
||||
const bnode2 = renderToBdom(template, { v: "zucchini" });
|
||||
patch(bnode1, bnode2);
|
||||
expect(input.value).toBe("zucchini");
|
||||
});
|
||||
|
||||
test("input, type checkbox, with t-att-checked (patching with same value", () => {
|
||||
// render input with initial value
|
||||
const template = `<input type="checkbox" t-att-checked="v"/>`;
|
||||
const bnode1 = renderToBdom(template, { v: true });
|
||||
const fixture = makeTestFixture();
|
||||
mount(bnode1, fixture);
|
||||
const input = fixture.querySelector("input")!;
|
||||
expect(input.checked).toBe(true);
|
||||
|
||||
// change checked manually in input, to simulate user input
|
||||
input.checked = false;
|
||||
expect(input.checked).toBe(false);
|
||||
|
||||
const bnode2 = renderToBdom(template, { v: true });
|
||||
patch(bnode1, bnode2);
|
||||
expect(input.checked).toBe(true);
|
||||
});
|
||||
|
||||
test("input of type checkbox with t-att-indeterminate", () => {
|
||||
const template = `<input type="checkbox" t-att-indeterminate="v"/>`;
|
||||
const bnode1 = renderToBdom(template, { v: true });
|
||||
|
||||
@@ -479,21 +479,4 @@ describe("t-call (template calling)", () => {
|
||||
"<span>123lucas</span>"
|
||||
);
|
||||
});
|
||||
|
||||
test("nested t-calls with magic variable 0", () => {
|
||||
const context = new TestContext();
|
||||
context.addTemplate("grandchild", `grandchild<t t-out="0"/>`);
|
||||
context.addTemplate("child", `<t t-out="0"/>`);
|
||||
context.addTemplate(
|
||||
"main",
|
||||
`
|
||||
<t t-call="child">
|
||||
<t t-call="grandchild">
|
||||
<p>Some content...</p>
|
||||
</t>
|
||||
</t>`
|
||||
);
|
||||
|
||||
expect(context.renderToString("main")).toBe("grandchild<p>Some content...</p>");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,21 +67,6 @@ describe("t-esc", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("t-esc with the 0 number", () => {
|
||||
const template = `<t t-esc="var"/>`;
|
||||
expect(renderToString(template, { var: 0 })).toBe("0");
|
||||
});
|
||||
|
||||
test("t-esc with the 0 number, in a p", () => {
|
||||
const template = `<p><t t-esc="var"/></p>`;
|
||||
expect(renderToString(template, { var: 0 })).toBe("<p>0</p>");
|
||||
});
|
||||
|
||||
test("top level t-esc with undefined", () => {
|
||||
const template = `<t t-esc="var"/>`;
|
||||
expect(renderToString(template, { var: undefined })).toBe("");
|
||||
});
|
||||
|
||||
test("falsy values in text nodes", () => {
|
||||
const template = `
|
||||
<t t-esc="v1"/>:<t t-esc="v2"/>:<t t-esc="v3"/>:<t t-esc="v4"/>:<t t-esc="v5"/>`;
|
||||
|
||||
@@ -47,21 +47,6 @@ describe("t-out", () => {
|
||||
expect(renderToString(template, { var: new String("ok") })).toBe("<span>ok</span>");
|
||||
});
|
||||
|
||||
test("t-out with the 0 number", () => {
|
||||
const template = `<t t-out="var"/>`;
|
||||
expect(renderToString(template, { var: 0 })).toBe("0");
|
||||
});
|
||||
|
||||
test("t-out with the 0 number, in a p", () => {
|
||||
const template = `<p><t t-out="var"/></p>`;
|
||||
expect(renderToString(template, { var: 0 })).toBe("<p>0</p>");
|
||||
});
|
||||
|
||||
test("top level t-out with undefined", () => {
|
||||
const template = `<t t-out="var"/>`;
|
||||
expect(renderToString(template, { var: undefined })).toBe("");
|
||||
});
|
||||
|
||||
test("with an extended String class", () => {
|
||||
class LoveString extends String {
|
||||
valueOf(): string {
|
||||
|
||||
@@ -33,22 +33,6 @@ describe("t-set", () => {
|
||||
expect(renderToString(template, { value: "ok" })).toBe("<div>grimbergen</div>");
|
||||
});
|
||||
|
||||
test("t-set, multiple t-ifs, and a specific configuration", () => {
|
||||
const template = `
|
||||
<p>
|
||||
<div>
|
||||
<t t-if="flag" t-set="bouh" t-value="2"/>
|
||||
<span>First div</span>
|
||||
</div>
|
||||
<div>
|
||||
<t t-if="!flag">Second</t>
|
||||
</div>
|
||||
</p>`;
|
||||
expect(renderToString(template)).toBe(
|
||||
"<p><div><span>First div</span></div><div>Second</div></p>"
|
||||
);
|
||||
});
|
||||
|
||||
test("set from body literal", () => {
|
||||
const template = `<t><t t-set="value">ok</t><t t-esc="value"/></t>`;
|
||||
expect(renderToString(template)).toBe("ok");
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`basics GrandChild display is controlled by its GrandParent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, false);
|
||||
|
||||
@@ -16,6 +17,7 @@ exports[`basics GrandChild display is controlled by its GrandParent 1`] = `
|
||||
exports[`basics GrandChild display is controlled by its GrandParent 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
||||
|
||||
@@ -32,6 +34,7 @@ exports[`basics GrandChild display is controlled by its GrandParent 2`] = `
|
||||
exports[`basics GrandChild display is controlled by its GrandParent 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -45,6 +48,7 @@ exports[`basics GrandChild display is controlled by its GrandParent 3`] = `
|
||||
exports[`basics Multi root component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<span>1</span>\`);
|
||||
@@ -62,6 +66,7 @@ exports[`basics Multi root component 1`] = `
|
||||
exports[`basics a class component inside a class component, no external dom 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -74,6 +79,7 @@ exports[`basics a class component inside a class component, no external dom 1`]
|
||||
exports[`basics a class component inside a class component, no external dom 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>simple vnode</div>\`);
|
||||
@@ -87,6 +93,7 @@ exports[`basics a class component inside a class component, no external dom 2`]
|
||||
exports[`basics a component cannot be mounted in a detached node (even if node is detached later) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -100,6 +107,7 @@ exports[`basics a component cannot be mounted in a detached node (even if node i
|
||||
exports[`basics a component inside a component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -115,6 +123,7 @@ exports[`basics a component inside a component 1`] = `
|
||||
exports[`basics a component inside a component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>simple vnode</div>\`);
|
||||
@@ -128,6 +137,7 @@ exports[`basics a component inside a component 2`] = `
|
||||
exports[`basics can be clicked on and updated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
|
||||
@@ -144,6 +154,7 @@ exports[`basics can be clicked on and updated 1`] = `
|
||||
exports[`basics can handle empty props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -159,6 +170,7 @@ exports[`basics can handle empty props 1`] = `
|
||||
exports[`basics can handle empty props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -173,6 +185,7 @@ exports[`basics can handle empty props 2`] = `
|
||||
exports[`basics can inject values in tagged templates 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
@@ -185,6 +198,7 @@ exports[`basics can inject values in tagged templates 1`] = `
|
||||
exports[`basics can inject values in tagged templates 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -199,6 +213,7 @@ exports[`basics can inject values in tagged templates 2`] = `
|
||||
exports[`basics can mount a component with just some text 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -210,6 +225,7 @@ exports[`basics can mount a component with just some text 1`] = `
|
||||
exports[`basics can mount a component with no text 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -221,6 +237,7 @@ exports[`basics can mount a component with no text 1`] = `
|
||||
exports[`basics can mount a simple component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -234,6 +251,7 @@ exports[`basics can mount a simple component 1`] = `
|
||||
exports[`basics can mount a simple component with multiple roots 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<span/>\`);
|
||||
@@ -250,6 +268,7 @@ exports[`basics can mount a simple component with multiple roots 1`] = `
|
||||
exports[`basics can mount a simple component with props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -264,6 +283,7 @@ exports[`basics can mount a simple component with props 1`] = `
|
||||
exports[`basics child can be updated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -276,6 +296,7 @@ exports[`basics child can be updated 1`] = `
|
||||
exports[`basics child can be updated 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -287,6 +308,7 @@ exports[`basics child can be updated 2`] = `
|
||||
exports[`basics class component with dynamic text 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>My value: <block-text-0/></span>\`);
|
||||
@@ -301,6 +323,7 @@ exports[`basics class component with dynamic text 1`] = `
|
||||
exports[`basics class parent, class child component with props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -313,6 +336,7 @@ exports[`basics class parent, class child component with props 1`] = `
|
||||
exports[`basics class parent, class child component with props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -327,6 +351,7 @@ exports[`basics class parent, class child component with props 2`] = `
|
||||
exports[`basics component children doesn't leak (if case) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -343,6 +368,7 @@ exports[`basics component children doesn't leak (if case) 1`] = `
|
||||
exports[`basics component children doesn't leak (if case) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -356,6 +382,7 @@ exports[`basics component children doesn't leak (if case) 2`] = `
|
||||
exports[`basics component children doesn't leak (t-key case) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -369,6 +396,7 @@ exports[`basics component children doesn't leak (t-key case) 1`] = `
|
||||
exports[`basics component children doesn't leak (t-key case) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -382,6 +410,7 @@ exports[`basics component children doesn't leak (t-key case) 2`] = `
|
||||
exports[`basics component with dynamic content can be updated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -396,6 +425,7 @@ exports[`basics component with dynamic content can be updated 1`] = `
|
||||
exports[`basics do not remove previously rendered dom if not necessary 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -409,6 +439,7 @@ exports[`basics do not remove previously rendered dom if not necessary 1`] = `
|
||||
exports[`basics do not remove previously rendered dom if not necessary, variation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><h1>h1</h1><span><block-text-0/></span></div>\`);
|
||||
@@ -423,6 +454,7 @@ exports[`basics do not remove previously rendered dom if not necessary, variatio
|
||||
exports[`basics higher order components parent and child 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -435,6 +467,7 @@ exports[`basics higher order components parent and child 1`] = `
|
||||
exports[`basics higher order components parent and child 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildA\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`ChildB\`, true, false, false, true);
|
||||
@@ -454,6 +487,7 @@ exports[`basics higher order components parent and child 2`] = `
|
||||
exports[`basics higher order components parent and child 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>a</div>\`);
|
||||
@@ -467,6 +501,7 @@ exports[`basics higher order components parent and child 3`] = `
|
||||
exports[`basics higher order components parent and child 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>b</span>\`);
|
||||
@@ -480,6 +515,7 @@ exports[`basics higher order components parent and child 4`] = `
|
||||
exports[`basics list of two sub components inside other nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`SubWidget\`, true, false, false, true);
|
||||
@@ -507,6 +543,7 @@ exports[`basics list of two sub components inside other nodes 1`] = `
|
||||
exports[`basics list of two sub components inside other nodes 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>asdf</span>\`);
|
||||
@@ -520,6 +557,7 @@ exports[`basics list of two sub components inside other nodes 2`] = `
|
||||
exports[`basics parent, child and grandchild 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -532,6 +570,7 @@ exports[`basics parent, child and grandchild 1`] = `
|
||||
exports[`basics parent, child and grandchild 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
||||
|
||||
@@ -544,6 +583,7 @@ exports[`basics parent, child and grandchild 2`] = `
|
||||
exports[`basics parent, child and grandchild 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey</div>\`);
|
||||
@@ -557,6 +597,7 @@ exports[`basics parent, child and grandchild 3`] = `
|
||||
exports[`basics props is set on root component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -570,6 +611,7 @@ exports[`basics props is set on root component 1`] = `
|
||||
exports[`basics props value are own property of props object 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -583,6 +625,7 @@ exports[`basics props value are own property of props object 1`] = `
|
||||
exports[`basics props value are own property of props object, even with default values 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -596,6 +639,7 @@ exports[`basics props value are own property of props object, even with default
|
||||
exports[`basics reconciliation alg is not confused in some specific situation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -614,6 +658,7 @@ exports[`basics reconciliation alg is not confused in some specific situation 1`
|
||||
exports[`basics reconciliation alg is not confused in some specific situation 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child</span>\`);
|
||||
@@ -627,6 +672,7 @@ exports[`basics reconciliation alg is not confused in some specific situation 2`
|
||||
exports[`basics rerendering a widget with a sub widget 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Counter\`, true, false, false, true);
|
||||
|
||||
@@ -639,6 +685,7 @@ exports[`basics rerendering a widget with a sub widget 1`] = `
|
||||
exports[`basics rerendering a widget with a sub widget 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
|
||||
@@ -655,6 +702,7 @@ exports[`basics rerendering a widget with a sub widget 2`] = `
|
||||
exports[`basics same t-keys in two different places 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -674,6 +722,7 @@ exports[`basics same t-keys in two different places 1`] = `
|
||||
exports[`basics same t-keys in two different places 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -688,6 +737,7 @@ exports[`basics same t-keys in two different places 2`] = `
|
||||
exports[`basics simple component with a dynamic text 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -702,6 +752,7 @@ exports[`basics simple component with a dynamic text 1`] = `
|
||||
exports[`basics simple component, useState 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -716,6 +767,7 @@ exports[`basics simple component, useState 1`] = `
|
||||
exports[`basics some simple sanity checks (el/status) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -729,6 +781,7 @@ exports[`basics some simple sanity checks (el/status) 1`] = `
|
||||
exports[`basics sub components between t-ifs 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -756,6 +809,7 @@ exports[`basics sub components between t-ifs 1`] = `
|
||||
exports[`basics sub components between t-ifs 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child</span>\`);
|
||||
@@ -769,6 +823,7 @@ exports[`basics sub components between t-ifs 2`] = `
|
||||
exports[`basics t-elif works with t-component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -790,6 +845,7 @@ exports[`basics t-elif works with t-component 1`] = `
|
||||
exports[`basics t-elif works with t-component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>hey</span>\`);
|
||||
@@ -803,6 +859,7 @@ exports[`basics t-elif works with t-component 2`] = `
|
||||
exports[`basics t-else with empty string works with t-component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -824,6 +881,7 @@ exports[`basics t-else with empty string works with t-component 1`] = `
|
||||
exports[`basics t-else with empty string works with t-component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>hey</span>\`);
|
||||
@@ -837,6 +895,7 @@ exports[`basics t-else with empty string works with t-component 2`] = `
|
||||
exports[`basics t-else works with t-component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -858,6 +917,7 @@ exports[`basics t-else works with t-component 1`] = `
|
||||
exports[`basics t-else works with t-component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>hey</span>\`);
|
||||
@@ -871,6 +931,7 @@ exports[`basics t-else works with t-component 2`] = `
|
||||
exports[`basics t-if works with t-component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -889,6 +950,7 @@ exports[`basics t-if works with t-component 1`] = `
|
||||
exports[`basics t-if works with t-component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>hey</span>\`);
|
||||
@@ -902,6 +964,7 @@ exports[`basics t-if works with t-component 2`] = `
|
||||
exports[`basics t-key on a component with t-if, and a sibling component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -923,6 +986,7 @@ exports[`basics t-key on a component with t-if, and a sibling component 1`] = `
|
||||
exports[`basics t-key on a component with t-if, and a sibling component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child</span>\`);
|
||||
@@ -936,6 +1000,7 @@ exports[`basics t-key on a component with t-if, and a sibling component 2`] = `
|
||||
exports[`basics text after a conditional component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -955,6 +1020,7 @@ exports[`basics text after a conditional component 1`] = `
|
||||
exports[`basics text after a conditional component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p>simple vnode</p>\`);
|
||||
@@ -968,6 +1034,7 @@ exports[`basics text after a conditional component 2`] = `
|
||||
exports[`basics three level of components with collapsing root nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -980,6 +1047,7 @@ exports[`basics three level of components with collapsing root nodes 1`] = `
|
||||
exports[`basics three level of components with collapsing root nodes 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
||||
|
||||
@@ -992,6 +1060,7 @@ exports[`basics three level of components with collapsing root nodes 2`] = `
|
||||
exports[`basics three level of components with collapsing root nodes 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>2</div>\`);
|
||||
@@ -1005,6 +1074,7 @@ exports[`basics three level of components with collapsing root nodes 3`] = `
|
||||
exports[`basics two child components 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -1020,6 +1090,7 @@ exports[`basics two child components 1`] = `
|
||||
exports[`basics two child components 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>simple vnode</div>\`);
|
||||
@@ -1033,6 +1104,7 @@ exports[`basics two child components 2`] = `
|
||||
exports[`basics update props of component without concrete own node 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
@@ -1049,6 +1121,7 @@ exports[`basics update props of component without concrete own node 1`] = `
|
||||
exports[`basics update props of component without concrete own node 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Custom\`, true, false, false, false);
|
||||
|
||||
@@ -1062,6 +1135,7 @@ exports[`basics update props of component without concrete own node 2`] = `
|
||||
exports[`basics update props of component without concrete own node 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"widget-subkey\\"><block-text-0/>__<block-text-1/></div>\`);
|
||||
@@ -1077,6 +1151,7 @@ exports[`basics update props of component without concrete own node 3`] = `
|
||||
exports[`basics updating a component with t-foreach as root 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -1096,6 +1171,7 @@ exports[`basics updating a component with t-foreach as root 1`] = `
|
||||
exports[`basics updating widget immediately 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -1108,6 +1184,7 @@ exports[`basics updating widget immediately 1`] = `
|
||||
exports[`basics updating widget immediately 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>abc<block-child-0/></span>\`);
|
||||
@@ -1125,6 +1202,7 @@ exports[`basics updating widget immediately 2`] = `
|
||||
exports[`basics widget after a t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`SomeComponent\`, true, false, false, true);
|
||||
@@ -1151,6 +1229,7 @@ exports[`basics widget after a t-foreach 1`] = `
|
||||
exports[`basics widget after a t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -1164,6 +1243,7 @@ exports[`basics widget after a t-foreach 2`] = `
|
||||
exports[`basics zero or one child components 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -1180,6 +1260,7 @@ exports[`basics zero or one child components 1`] = `
|
||||
exports[`basics zero or one child components 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>simple vnode</div>\`);
|
||||
@@ -1193,6 +1274,7 @@ exports[`basics zero or one child components 2`] = `
|
||||
exports[`mount targets can mount a component (with default position='last-child') 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>app</div>\`);
|
||||
@@ -1206,6 +1288,7 @@ exports[`mount targets can mount a component (with default position='last-child'
|
||||
exports[`mount targets can mount a component (with position='first-child') 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>app</div>\`);
|
||||
@@ -1219,6 +1302,7 @@ exports[`mount targets can mount a component (with position='first-child') 1`] =
|
||||
exports[`mount targets default mount option is 'last-child' 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>app</div>\`);
|
||||
@@ -1232,6 +1316,7 @@ exports[`mount targets default mount option is 'last-child' 1`] = `
|
||||
exports[`mount targets mount function: can mount a component (with default position='last-child') 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>app</div>\`);
|
||||
@@ -1245,6 +1330,7 @@ exports[`mount targets mount function: can mount a component (with default posit
|
||||
exports[`support svg components add proper namespace to svg 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`GComp\`, true, false, false, true);
|
||||
|
||||
@@ -1260,6 +1346,7 @@ exports[`support svg components add proper namespace to svg 1`] = `
|
||||
exports[`support svg components add proper namespace to svg 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<g block-ns=\\"http://www.w3.org/2000/svg\\"><circle cx=\\"50\\" cy=\\"50\\" r=\\"4\\" stroke=\\"green\\" stroke-width=\\"1\\" fill=\\"yellow\\"/></g>\`);
|
||||
@@ -1273,6 +1360,7 @@ exports[`support svg components add proper namespace to svg 2`] = `
|
||||
exports[`t-out in components can render list of t-out 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, safeOutput, withKey } = helpers;
|
||||
|
||||
@@ -1297,6 +1385,7 @@ exports[`t-out in components can render list of t-out 1`] = `
|
||||
exports[`t-out in components can switch the contents of two t-out repeatedly 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -1308,21 +1397,10 @@ exports[`t-out in components can switch the contents of two t-out repeatedly 1`]
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-out in components t-out and updating falsy values, 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return safeOutput(ctx['state'].a);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-out in components update properly on state changes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`Cascading renders after microtaskTick 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -26,6 +27,7 @@ exports[`Cascading renders after microtaskTick 1`] = `
|
||||
exports[`Cascading renders after microtaskTick 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Element\`, true, false, false, false);
|
||||
@@ -46,6 +48,7 @@ exports[`Cascading renders after microtaskTick 2`] = `
|
||||
exports[`Cascading renders after microtaskTick 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -57,6 +60,7 @@ exports[`Cascading renders after microtaskTick 3`] = `
|
||||
exports[`another scenario with delayed rendering 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -74,6 +78,7 @@ exports[`another scenario with delayed rendering 1`] = `
|
||||
exports[`another scenario with delayed rendering 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -88,6 +93,7 @@ exports[`another scenario with delayed rendering 2`] = `
|
||||
exports[`another scenario with delayed rendering 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
@@ -103,6 +109,7 @@ exports[`another scenario with delayed rendering 3`] = `
|
||||
exports[`async rendering destroying a widget before start is over 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -116,6 +123,7 @@ exports[`async rendering destroying a widget before start is over 1`] = `
|
||||
exports[`calling render in destroy 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -129,6 +137,7 @@ exports[`calling render in destroy 1`] = `
|
||||
exports[`calling render in destroy 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
||||
|
||||
@@ -141,6 +150,7 @@ exports[`calling render in destroy 2`] = `
|
||||
exports[`calling render in destroy 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -155,6 +165,7 @@ exports[`calling render in destroy 3`] = `
|
||||
exports[`change state and call manually render: no unnecessary rendering 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -169,6 +180,7 @@ exports[`change state and call manually render: no unnecessary rendering 1`] = `
|
||||
exports[`changing state before first render does not trigger a render (with parent) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`TestW\`, true, false, false, true);
|
||||
|
||||
@@ -187,6 +199,7 @@ exports[`changing state before first render does not trigger a render (with pare
|
||||
exports[`changing state before first render does not trigger a render (with parent) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -201,6 +214,7 @@ exports[`changing state before first render does not trigger a render (with pare
|
||||
exports[`changing state before first render does not trigger a render 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -215,6 +229,7 @@ exports[`changing state before first render does not trigger a render 1`] = `
|
||||
exports[`concurrent renderings scenario 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -230,6 +245,7 @@ exports[`concurrent renderings scenario 1 1`] = `
|
||||
exports[`concurrent renderings scenario 1 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
|
||||
|
||||
@@ -245,6 +261,7 @@ exports[`concurrent renderings scenario 1 2`] = `
|
||||
exports[`concurrent renderings scenario 1 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
@@ -260,6 +277,7 @@ exports[`concurrent renderings scenario 1 3`] = `
|
||||
exports[`concurrent renderings scenario 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -276,6 +294,7 @@ exports[`concurrent renderings scenario 2 1`] = `
|
||||
exports[`concurrent renderings scenario 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
|
||||
|
||||
@@ -291,6 +310,7 @@ exports[`concurrent renderings scenario 2 2`] = `
|
||||
exports[`concurrent renderings scenario 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
@@ -306,6 +326,7 @@ exports[`concurrent renderings scenario 2 3`] = `
|
||||
exports[`concurrent renderings scenario 2bis 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -321,6 +342,7 @@ exports[`concurrent renderings scenario 2bis 1`] = `
|
||||
exports[`concurrent renderings scenario 2bis 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
|
||||
|
||||
@@ -336,6 +358,7 @@ exports[`concurrent renderings scenario 2bis 2`] = `
|
||||
exports[`concurrent renderings scenario 2bis 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
@@ -351,6 +374,7 @@ exports[`concurrent renderings scenario 2bis 3`] = `
|
||||
exports[`concurrent renderings scenario 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -366,6 +390,7 @@ exports[`concurrent renderings scenario 3 1`] = `
|
||||
exports[`concurrent renderings scenario 3 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
|
||||
|
||||
@@ -381,6 +406,7 @@ exports[`concurrent renderings scenario 3 2`] = `
|
||||
exports[`concurrent renderings scenario 3 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentD\`, true, false, false, false);
|
||||
|
||||
@@ -396,6 +422,7 @@ exports[`concurrent renderings scenario 3 3`] = `
|
||||
exports[`concurrent renderings scenario 3 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<i><block-text-0/><block-text-1/></i>\`);
|
||||
@@ -411,6 +438,7 @@ exports[`concurrent renderings scenario 3 4`] = `
|
||||
exports[`concurrent renderings scenario 4 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -426,6 +454,7 @@ exports[`concurrent renderings scenario 4 1`] = `
|
||||
exports[`concurrent renderings scenario 4 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
|
||||
|
||||
@@ -441,6 +470,7 @@ exports[`concurrent renderings scenario 4 2`] = `
|
||||
exports[`concurrent renderings scenario 4 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentD\`, true, false, false, false);
|
||||
|
||||
@@ -456,6 +486,7 @@ exports[`concurrent renderings scenario 4 3`] = `
|
||||
exports[`concurrent renderings scenario 4 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<i><block-text-0/><block-text-1/></i>\`);
|
||||
@@ -471,6 +502,7 @@ exports[`concurrent renderings scenario 4 4`] = `
|
||||
exports[`concurrent renderings scenario 5 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -486,6 +518,7 @@ exports[`concurrent renderings scenario 5 1`] = `
|
||||
exports[`concurrent renderings scenario 5 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
@@ -500,6 +533,7 @@ exports[`concurrent renderings scenario 5 2`] = `
|
||||
exports[`concurrent renderings scenario 6 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -515,6 +549,7 @@ exports[`concurrent renderings scenario 6 1`] = `
|
||||
exports[`concurrent renderings scenario 6 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
@@ -529,6 +564,7 @@ exports[`concurrent renderings scenario 6 2`] = `
|
||||
exports[`concurrent renderings scenario 7 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -544,6 +580,7 @@ exports[`concurrent renderings scenario 7 1`] = `
|
||||
exports[`concurrent renderings scenario 7 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/><block-text-1/></p>\`);
|
||||
@@ -559,6 +596,7 @@ exports[`concurrent renderings scenario 7 2`] = `
|
||||
exports[`concurrent renderings scenario 8 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -574,6 +612,7 @@ exports[`concurrent renderings scenario 8 1`] = `
|
||||
exports[`concurrent renderings scenario 8 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/><block-text-1/></p>\`);
|
||||
@@ -589,6 +628,7 @@ exports[`concurrent renderings scenario 8 2`] = `
|
||||
exports[`concurrent renderings scenario 9 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`ComponentC\`, true, false, false, false);
|
||||
@@ -607,6 +647,7 @@ exports[`concurrent renderings scenario 9 1`] = `
|
||||
exports[`concurrent renderings scenario 9 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<b><block-text-0/></b>\`);
|
||||
@@ -621,6 +662,7 @@ exports[`concurrent renderings scenario 9 2`] = `
|
||||
exports[`concurrent renderings scenario 9 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentD\`, true, false, false, false);
|
||||
|
||||
@@ -636,6 +678,7 @@ exports[`concurrent renderings scenario 9 3`] = `
|
||||
exports[`concurrent renderings scenario 9 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
@@ -651,6 +694,7 @@ exports[`concurrent renderings scenario 9 4`] = `
|
||||
exports[`concurrent renderings scenario 10 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
|
||||
|
||||
@@ -666,6 +710,7 @@ exports[`concurrent renderings scenario 10 1`] = `
|
||||
exports[`concurrent renderings scenario 10 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
|
||||
|
||||
@@ -684,6 +729,7 @@ exports[`concurrent renderings scenario 10 2`] = `
|
||||
exports[`concurrent renderings scenario 10 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -698,6 +744,7 @@ exports[`concurrent renderings scenario 10 3`] = `
|
||||
exports[`concurrent renderings scenario 11 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -713,6 +760,7 @@ exports[`concurrent renderings scenario 11 1`] = `
|
||||
exports[`concurrent renderings scenario 11 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/>|<block-text-1/></span>\`);
|
||||
@@ -728,6 +776,7 @@ exports[`concurrent renderings scenario 11 2`] = `
|
||||
exports[`concurrent renderings scenario 12 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -743,6 +792,7 @@ exports[`concurrent renderings scenario 12 1`] = `
|
||||
exports[`concurrent renderings scenario 12 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -757,6 +807,7 @@ exports[`concurrent renderings scenario 12 2`] = `
|
||||
exports[`concurrent renderings scenario 13 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -777,6 +828,7 @@ exports[`concurrent renderings scenario 13 1`] = `
|
||||
exports[`concurrent renderings scenario 13 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -791,6 +843,7 @@ exports[`concurrent renderings scenario 13 2`] = `
|
||||
exports[`concurrent renderings scenario 14 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -806,6 +859,7 @@ exports[`concurrent renderings scenario 14 1`] = `
|
||||
exports[`concurrent renderings scenario 14 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
||||
|
||||
@@ -821,6 +875,7 @@ exports[`concurrent renderings scenario 14 2`] = `
|
||||
exports[`concurrent renderings scenario 14 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><span><block-text-0/></span><span><block-text-1/></span><span><block-text-2/></span></p>\`);
|
||||
@@ -837,6 +892,7 @@ exports[`concurrent renderings scenario 14 3`] = `
|
||||
exports[`concurrent renderings scenario 15 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -852,6 +908,7 @@ exports[`concurrent renderings scenario 15 1`] = `
|
||||
exports[`concurrent renderings scenario 15 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
||||
|
||||
@@ -867,6 +924,7 @@ exports[`concurrent renderings scenario 15 2`] = `
|
||||
exports[`concurrent renderings scenario 15 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><span><block-text-0/></span><span><block-text-1/></span><span><block-text-2/></span></p>\`);
|
||||
@@ -883,6 +941,7 @@ exports[`concurrent renderings scenario 15 3`] = `
|
||||
exports[`concurrent renderings scenario 16 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -895,6 +954,7 @@ exports[`concurrent renderings scenario 16 1`] = `
|
||||
exports[`concurrent renderings scenario 16 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
||||
|
||||
@@ -907,6 +967,7 @@ exports[`concurrent renderings scenario 16 2`] = `
|
||||
exports[`concurrent renderings scenario 16 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`D\`, true, false, false, true);
|
||||
|
||||
@@ -929,6 +990,7 @@ exports[`concurrent renderings scenario 16 3`] = `
|
||||
exports[`concurrent renderings scenario 16 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -940,6 +1002,7 @@ exports[`concurrent renderings scenario 16 4`] = `
|
||||
exports[`creating two async components, scenario 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildA\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`ChildB\`, true, false, false, true);
|
||||
@@ -960,6 +1023,7 @@ exports[`creating two async components, scenario 1 1`] = `
|
||||
exports[`creating two async components, scenario 1 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -974,6 +1038,7 @@ exports[`creating two async components, scenario 1 2`] = `
|
||||
exports[`creating two async components, scenario 1 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>b</span>\`);
|
||||
@@ -987,6 +1052,7 @@ exports[`creating two async components, scenario 1 3`] = `
|
||||
exports[`creating two async components, scenario 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`ChildB\`, true, false, false, false);
|
||||
@@ -1007,6 +1073,7 @@ exports[`creating two async components, scenario 2 1`] = `
|
||||
exports[`creating two async components, scenario 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>a<block-text-0/></span>\`);
|
||||
@@ -1021,6 +1088,7 @@ exports[`creating two async components, scenario 2 2`] = `
|
||||
exports[`creating two async components, scenario 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>b<block-text-0/></span>\`);
|
||||
@@ -1035,6 +1103,7 @@ exports[`creating two async components, scenario 2 3`] = `
|
||||
exports[`creating two async components, scenario 3 (patching in the same frame) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`ChildB\`, true, false, false, false);
|
||||
@@ -1055,6 +1124,7 @@ exports[`creating two async components, scenario 3 (patching in the same frame)
|
||||
exports[`creating two async components, scenario 3 (patching in the same frame) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>a<block-text-0/></span>\`);
|
||||
@@ -1069,6 +1139,7 @@ exports[`creating two async components, scenario 3 (patching in the same frame)
|
||||
exports[`creating two async components, scenario 3 (patching in the same frame) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>b<block-text-0/></span>\`);
|
||||
@@ -1083,6 +1154,7 @@ exports[`creating two async components, scenario 3 (patching in the same frame)
|
||||
exports[`delay willUpdateProps 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -1095,6 +1167,7 @@ exports[`delay willUpdateProps 1`] = `
|
||||
exports[`delay willUpdateProps 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1109,6 +1182,7 @@ exports[`delay willUpdateProps 2`] = `
|
||||
exports[`delay willUpdateProps with rendering grandchild 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Parent\`, true, false, false, false);
|
||||
|
||||
@@ -1121,6 +1195,7 @@ exports[`delay willUpdateProps with rendering grandchild 1`] = `
|
||||
exports[`delay willUpdateProps with rendering grandchild 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`DelayedChild\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`ReactiveChild\`, true, false, false, true);
|
||||
@@ -1136,6 +1211,7 @@ exports[`delay willUpdateProps with rendering grandchild 2`] = `
|
||||
exports[`delay willUpdateProps with rendering grandchild 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1150,6 +1226,7 @@ exports[`delay willUpdateProps with rendering grandchild 3`] = `
|
||||
exports[`delay willUpdateProps with rendering grandchild 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -1163,6 +1240,7 @@ exports[`delay willUpdateProps with rendering grandchild 4`] = `
|
||||
exports[`delayed fiber does not get rendered if it was cancelled 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, true);
|
||||
|
||||
@@ -1177,6 +1255,7 @@ exports[`delayed fiber does not get rendered if it was cancelled 1`] = `
|
||||
exports[`delayed fiber does not get rendered if it was cancelled 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -1191,6 +1270,7 @@ exports[`delayed fiber does not get rendered if it was cancelled 2`] = `
|
||||
exports[`delayed fiber does not get rendered if it was cancelled 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`D\`, true, false, false, true);
|
||||
|
||||
@@ -1205,6 +1285,7 @@ exports[`delayed fiber does not get rendered if it was cancelled 3`] = `
|
||||
exports[`delayed fiber does not get rendered if it was cancelled 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1216,6 +1297,7 @@ exports[`delayed fiber does not get rendered if it was cancelled 4`] = `
|
||||
exports[`delayed rendering, but then initial rendering is cancelled by yet another render 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -1228,6 +1310,7 @@ exports[`delayed rendering, but then initial rendering is cancelled by yet anoth
|
||||
exports[`delayed rendering, but then initial rendering is cancelled by yet another render 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
||||
|
||||
@@ -1240,6 +1323,7 @@ exports[`delayed rendering, but then initial rendering is cancelled by yet anoth
|
||||
exports[`delayed rendering, but then initial rendering is cancelled by yet another render 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`D\`, true, false, false, true);
|
||||
|
||||
@@ -1257,6 +1341,7 @@ exports[`delayed rendering, but then initial rendering is cancelled by yet anoth
|
||||
exports[`delayed rendering, but then initial rendering is cancelled by yet another render 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
@@ -1272,6 +1357,7 @@ exports[`delayed rendering, but then initial rendering is cancelled by yet anoth
|
||||
exports[`delayed rendering, destruction, stuff happens 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -1286,6 +1372,7 @@ exports[`delayed rendering, destruction, stuff happens 1`] = `
|
||||
exports[`delayed rendering, destruction, stuff happens 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
||||
|
||||
@@ -1303,6 +1390,7 @@ exports[`delayed rendering, destruction, stuff happens 2`] = `
|
||||
exports[`delayed rendering, destruction, stuff happens 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`D\`, true, false, false, true);
|
||||
|
||||
@@ -1321,6 +1409,7 @@ exports[`delayed rendering, destruction, stuff happens 3`] = `
|
||||
exports[`delayed rendering, destruction, stuff happens 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
@@ -1338,6 +1427,7 @@ exports[`delayed rendering, destruction, stuff happens 4`] = `
|
||||
exports[`delayed rendering, reusing fiber and stuff 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -1350,6 +1440,7 @@ exports[`delayed rendering, reusing fiber and stuff 1`] = `
|
||||
exports[`delayed rendering, reusing fiber and stuff 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -1364,6 +1455,7 @@ exports[`delayed rendering, reusing fiber and stuff 2`] = `
|
||||
exports[`delayed rendering, reusing fiber and stuff 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
@@ -1379,6 +1471,7 @@ exports[`delayed rendering, reusing fiber and stuff 3`] = `
|
||||
exports[`delayed rendering, reusing fiber then component is destroyed and stuff 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -1396,6 +1489,7 @@ exports[`delayed rendering, reusing fiber then component is destroyed and stuff
|
||||
exports[`delayed rendering, reusing fiber then component is destroyed and stuff 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -1410,6 +1504,7 @@ exports[`delayed rendering, reusing fiber then component is destroyed and stuff
|
||||
exports[`delayed rendering, reusing fiber then component is destroyed and stuff 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
@@ -1425,6 +1520,7 @@ exports[`delayed rendering, reusing fiber then component is destroyed and stuff
|
||||
exports[`delayed rendering, then component is destroyed and stuff 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -1437,6 +1533,7 @@ exports[`delayed rendering, then component is destroyed and stuff 1`] = `
|
||||
exports[`delayed rendering, then component is destroyed and stuff 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -1454,6 +1551,7 @@ exports[`delayed rendering, then component is destroyed and stuff 2`] = `
|
||||
exports[`delayed rendering, then component is destroyed and stuff 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
@@ -1469,6 +1567,7 @@ exports[`delayed rendering, then component is destroyed and stuff 3`] = `
|
||||
exports[`destroyed component causes other soon to be destroyed component to rerender, weird stuff happens 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`C\`, true, false, false, false);
|
||||
@@ -1489,6 +1588,7 @@ exports[`destroyed component causes other soon to be destroyed component to rere
|
||||
exports[`destroyed component causes other soon to be destroyed component to rerender, weird stuff happens 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1500,6 +1600,7 @@ exports[`destroyed component causes other soon to be destroyed component to rere
|
||||
exports[`destroyed component causes other soon to be destroyed component to rerender, weird stuff happens 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1511,6 +1612,7 @@ exports[`destroyed component causes other soon to be destroyed component to rere
|
||||
exports[`destroying/recreating a subcomponent, other scenario 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -1528,6 +1630,7 @@ exports[`destroying/recreating a subcomponent, other scenario 1`] = `
|
||||
exports[`destroying/recreating a subcomponent, other scenario 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1539,6 +1642,7 @@ exports[`destroying/recreating a subcomponent, other scenario 2`] = `
|
||||
exports[`destroying/recreating a subwidget with different props (if start is not over) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -1557,6 +1661,7 @@ exports[`destroying/recreating a subwidget with different props (if start is not
|
||||
exports[`destroying/recreating a subwidget with different props (if start is not over) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child:<block-text-0/></span>\`);
|
||||
@@ -1571,6 +1676,7 @@ exports[`destroying/recreating a subwidget with different props (if start is not
|
||||
exports[`parent and child rendered at exact same time 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -1583,6 +1689,7 @@ exports[`parent and child rendered at exact same time 1`] = `
|
||||
exports[`parent and child rendered at exact same time 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1594,6 +1701,7 @@ exports[`parent and child rendered at exact same time 2`] = `
|
||||
exports[`properly behave when destroyed/unmounted while rendering 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -1612,6 +1720,7 @@ exports[`properly behave when destroyed/unmounted while rendering 1`] = `
|
||||
exports[`properly behave when destroyed/unmounted while rendering 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SubChild\`, true, false, false, false);
|
||||
|
||||
@@ -1627,6 +1736,7 @@ exports[`properly behave when destroyed/unmounted while rendering 2`] = `
|
||||
exports[`properly behave when destroyed/unmounted while rendering 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -1640,6 +1750,7 @@ exports[`properly behave when destroyed/unmounted while rendering 3`] = `
|
||||
exports[`rendering component again in next microtick 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -1659,6 +1770,7 @@ exports[`rendering component again in next microtick 1`] = `
|
||||
exports[`rendering component again in next microtick 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Child</div>\`);
|
||||
@@ -1672,6 +1784,7 @@ exports[`rendering component again in next microtick 2`] = `
|
||||
exports[`rendering parent twice, with different props on child and stuff 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -1684,6 +1797,7 @@ exports[`rendering parent twice, with different props on child and stuff 1`] = `
|
||||
exports[`rendering parent twice, with different props on child and stuff 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1695,6 +1809,7 @@ exports[`rendering parent twice, with different props on child and stuff 2`] = `
|
||||
exports[`renderings, destruction, patch, stuff, ... yet another variation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`D\`, true, false, false, true);
|
||||
@@ -1711,6 +1826,7 @@ exports[`renderings, destruction, patch, stuff, ... yet another variation 1`] =
|
||||
exports[`renderings, destruction, patch, stuff, ... yet another variation 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -1728,6 +1844,7 @@ exports[`renderings, destruction, patch, stuff, ... yet another variation 2`] =
|
||||
exports[`renderings, destruction, patch, stuff, ... yet another variation 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<p block-handler-0=\\"click\\"><block-text-1/></p>\`);
|
||||
@@ -1745,6 +1862,7 @@ exports[`renderings, destruction, patch, stuff, ... yet another variation 3`] =
|
||||
exports[`renderings, destruction, patch, stuff, ... yet another variation 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block3 = createBlock(\`<span block-handler-0=\\"click\\"><block-text-1/></span>\`);
|
||||
@@ -1762,6 +1880,7 @@ exports[`renderings, destruction, patch, stuff, ... yet another variation 4`] =
|
||||
exports[`t-foreach with dynamic async component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(null, false, false, false, false);
|
||||
@@ -1788,6 +1907,7 @@ exports[`t-foreach with dynamic async component 1`] = `
|
||||
exports[`t-foreach with dynamic async component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -1802,6 +1922,7 @@ exports[`t-foreach with dynamic async component 2`] = `
|
||||
exports[`t-key on dom node having a component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, false);
|
||||
|
||||
@@ -1819,6 +1940,7 @@ exports[`t-key on dom node having a component 1`] = `
|
||||
exports[`t-key on dom node having a component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1830,6 +1952,7 @@ exports[`t-key on dom node having a component 2`] = `
|
||||
exports[`t-key on dynamic async component (toggler is never patched) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, false);
|
||||
|
||||
@@ -1844,6 +1967,7 @@ exports[`t-key on dynamic async component (toggler is never patched) 1`] = `
|
||||
exports[`t-key on dynamic async component (toggler is never patched) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -1858,6 +1982,7 @@ exports[`t-key on dynamic async component (toggler is never patched) 2`] = `
|
||||
exports[`two renderings initiated between willPatch and patched 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Panel\`, true, false, false, false);
|
||||
|
||||
@@ -1877,6 +2002,7 @@ exports[`two renderings initiated between willPatch and patched 1`] = `
|
||||
exports[`two renderings initiated between willPatch and patched 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<abc><block-text-0/><block-text-1/></abc>\`);
|
||||
@@ -1892,6 +2018,7 @@ exports[`two renderings initiated between willPatch and patched 2`] = `
|
||||
exports[`two sequential renderings before an animation frame 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -1904,6 +2031,7 @@ exports[`two sequential renderings before an animation frame 1`] = `
|
||||
exports[`two sequential renderings before an animation frame 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1915,6 +2043,7 @@ exports[`two sequential renderings before an animation frame 2`] = `
|
||||
exports[`update a sub-component twice in the same frame 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
|
||||
|
||||
@@ -1930,6 +2059,7 @@ exports[`update a sub-component twice in the same frame 1`] = `
|
||||
exports[`update a sub-component twice in the same frame 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -1944,6 +2074,7 @@ exports[`update a sub-component twice in the same frame 2`] = `
|
||||
exports[`update a sub-component twice in the same frame, 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
|
||||
|
||||
@@ -1959,6 +2090,7 @@ exports[`update a sub-component twice in the same frame, 2 1`] = `
|
||||
exports[`update a sub-component twice in the same frame, 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`basics display a nice error if a component is not a component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SomeComponent\`, true, false, false, true);
|
||||
|
||||
@@ -15,12 +16,13 @@ exports[`basics display a nice error if a component is not a component 1`] = `
|
||||
exports[`basics display a nice error if it cannot find component (in dev mode) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SomeMispelledComponent\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const props1 = {};
|
||||
helpers.validateProps(\`SomeMispelledComponent\`, props1, this);
|
||||
helpers.validateProps(\`SomeMispelledComponent\`, props1, ctx);
|
||||
return comp1(props1, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
@@ -29,6 +31,7 @@ exports[`basics display a nice error if it cannot find component (in dev mode) 1
|
||||
exports[`basics display a nice error if it cannot find component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`SomeMispelledComponent\`, true, false, false, true);
|
||||
|
||||
@@ -41,6 +44,7 @@ exports[`basics display a nice error if it cannot find component 1`] = `
|
||||
exports[`basics no component catching error lead to full app destruction 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
||||
|
||||
@@ -56,6 +60,7 @@ exports[`basics no component catching error lead to full app destruction 1`] = `
|
||||
exports[`basics no component catching error lead to full app destruction 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
@@ -70,6 +75,7 @@ exports[`basics no component catching error lead to full app destruction 2`] = `
|
||||
exports[`basics simple catchError 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
||||
|
||||
@@ -90,6 +96,7 @@ exports[`basics simple catchError 1`] = `
|
||||
exports[`basics simple catchError 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -101,75 +108,10 @@ exports[`basics simple catchError 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`can catch errors Errors have the right cause 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['state'].value);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`can catch errors Errors in owl lifecycle are wrapped in dev mode: async hook 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['state'].value);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`can catch errors Errors in owl lifecycle are wrapped out of dev mode: async hook 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['state'].value);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`can catch errors Errors in owl lifecycle are wrapped outside dev mode: sync hook 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['state'].value);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`can catch errors Thrown values that are not errors are wrapped in dev mode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['state'].value);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`can catch errors Thrown values that are not errors are wrapped outside dev mode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(ctx['state'].value);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`can catch errors an error in onWillDestroy 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -187,6 +129,7 @@ exports[`can catch errors an error in onWillDestroy 1`] = `
|
||||
exports[`can catch errors an error in onWillDestroy 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>abc</div>\`);
|
||||
@@ -200,6 +143,7 @@ exports[`can catch errors an error in onWillDestroy 2`] = `
|
||||
exports[`can catch errors an error in onWillDestroy, variation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -217,6 +161,7 @@ exports[`can catch errors an error in onWillDestroy, variation 1`] = `
|
||||
exports[`can catch errors an error in onWillDestroy, variation 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>abc</div>\`);
|
||||
@@ -230,6 +175,7 @@ exports[`can catch errors an error in onWillDestroy, variation 2`] = `
|
||||
exports[`can catch errors calling a hook outside setup should crash 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -241,6 +187,7 @@ exports[`can catch errors calling a hook outside setup should crash 1`] = `
|
||||
exports[`can catch errors can catch an error in a component render function 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
||||
@@ -262,6 +209,7 @@ exports[`can catch errors can catch an error in a component render function 1`]
|
||||
exports[`can catch errors can catch an error in a component render function 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -282,6 +230,7 @@ exports[`can catch errors can catch an error in a component render function 2`]
|
||||
exports[`can catch errors can catch an error in a component render function 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
@@ -296,6 +245,7 @@ exports[`can catch errors can catch an error in a component render function 3`]
|
||||
exports[`can catch errors can catch an error in the constructor call of a component render function 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
||||
@@ -317,6 +267,7 @@ exports[`can catch errors can catch an error in the constructor call of a compon
|
||||
exports[`can catch errors can catch an error in the constructor call of a component render function 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -337,6 +288,7 @@ exports[`can catch errors can catch an error in the constructor call of a compon
|
||||
exports[`can catch errors can catch an error in the constructor call of a component render function 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ClassicCompoent\`, true, false, false, true);
|
||||
@@ -361,6 +313,7 @@ exports[`can catch errors can catch an error in the constructor call of a compon
|
||||
exports[`can catch errors can catch an error in the constructor call of a component render function 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -381,6 +334,7 @@ exports[`can catch errors can catch an error in the constructor call of a compon
|
||||
exports[`can catch errors can catch an error in the constructor call of a component render function 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>classic</div>\`);
|
||||
@@ -394,6 +348,7 @@ exports[`can catch errors can catch an error in the constructor call of a compon
|
||||
exports[`can catch errors can catch an error in the constructor call of a component render function 2 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Some text</div>\`);
|
||||
@@ -407,6 +362,7 @@ exports[`can catch errors can catch an error in the constructor call of a compon
|
||||
exports[`can catch errors can catch an error in the constructor call of a component render function 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Some text</div>\`);
|
||||
@@ -420,6 +376,7 @@ exports[`can catch errors can catch an error in the constructor call of a compon
|
||||
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
||||
@@ -441,6 +398,7 @@ exports[`can catch errors can catch an error in the initial call of a component
|
||||
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -461,6 +419,7 @@ exports[`can catch errors can catch an error in the initial call of a component
|
||||
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
@@ -475,6 +434,7 @@ exports[`can catch errors can catch an error in the initial call of a component
|
||||
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
||||
@@ -499,6 +459,7 @@ exports[`can catch errors can catch an error in the initial call of a component
|
||||
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -519,6 +480,7 @@ exports[`can catch errors can catch an error in the initial call of a component
|
||||
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
@@ -533,6 +495,7 @@ exports[`can catch errors can catch an error in the initial call of a component
|
||||
exports[`can catch errors can catch an error in the mounted call (in child of child) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, true);
|
||||
|
||||
@@ -545,6 +508,7 @@ exports[`can catch errors can catch an error in the mounted call (in child of ch
|
||||
exports[`can catch errors can catch an error in the mounted call (in child of child) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -560,6 +524,7 @@ exports[`can catch errors can catch an error in the mounted call (in child of ch
|
||||
exports[`can catch errors can catch an error in the mounted call (in child of child) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
||||
|
||||
@@ -580,6 +545,7 @@ exports[`can catch errors can catch an error in the mounted call (in child of ch
|
||||
exports[`can catch errors can catch an error in the mounted call (in child of child) 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Some text</div>\`);
|
||||
@@ -593,6 +559,7 @@ exports[`can catch errors can catch an error in the mounted call (in child of ch
|
||||
exports[`can catch errors can catch an error in the mounted call (in root component) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
||||
|
||||
@@ -613,6 +580,7 @@ exports[`can catch errors can catch an error in the mounted call (in root compon
|
||||
exports[`can catch errors can catch an error in the mounted call (in root component) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Some text</div>\`);
|
||||
@@ -626,6 +594,7 @@ exports[`can catch errors can catch an error in the mounted call (in root compon
|
||||
exports[`can catch errors can catch an error in the mounted call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
||||
@@ -647,6 +616,7 @@ exports[`can catch errors can catch an error in the mounted call 1`] = `
|
||||
exports[`can catch errors can catch an error in the mounted call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -667,6 +637,7 @@ exports[`can catch errors can catch an error in the mounted call 2`] = `
|
||||
exports[`can catch errors can catch an error in the mounted call 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Some text</div>\`);
|
||||
@@ -680,6 +651,7 @@ exports[`can catch errors can catch an error in the mounted call 3`] = `
|
||||
exports[`can catch errors can catch an error in the willPatch call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
||||
@@ -702,6 +674,7 @@ exports[`can catch errors can catch an error in the willPatch call 1`] = `
|
||||
exports[`can catch errors can catch an error in the willPatch call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -722,6 +695,7 @@ exports[`can catch errors can catch an error in the willPatch call 2`] = `
|
||||
exports[`can catch errors can catch an error in the willPatch call 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -736,6 +710,7 @@ exports[`can catch errors can catch an error in the willPatch call 3`] = `
|
||||
exports[`can catch errors can catch an error in the willStart call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
||||
@@ -757,6 +732,7 @@ exports[`can catch errors can catch an error in the willStart call 1`] = `
|
||||
exports[`can catch errors can catch an error in the willStart call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -777,6 +753,7 @@ exports[`can catch errors can catch an error in the willStart call 2`] = `
|
||||
exports[`can catch errors can catch an error in the willStart call 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Some text</div>\`);
|
||||
@@ -790,6 +767,7 @@ exports[`can catch errors can catch an error in the willStart call 3`] = `
|
||||
exports[`can catch errors can catch an error origination from a child's willStart function 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`ClassicCompoent\`, true, false, false, true);
|
||||
@@ -814,6 +792,7 @@ exports[`can catch errors can catch an error origination from a child's willStar
|
||||
exports[`can catch errors can catch an error origination from a child's willStart function 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -834,6 +813,7 @@ exports[`can catch errors can catch an error origination from a child's willStar
|
||||
exports[`can catch errors can catch an error origination from a child's willStart function 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>classic</div>\`);
|
||||
@@ -847,6 +827,7 @@ exports[`can catch errors can catch an error origination from a child's willStar
|
||||
exports[`can catch errors can catch an error origination from a child's willStart function 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Some text</div>\`);
|
||||
@@ -860,6 +841,7 @@ exports[`can catch errors can catch an error origination from a child's willStar
|
||||
exports[`can catch errors catchError in catchError 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -880,6 +862,7 @@ exports[`can catch errors catchError in catchError 1`] = `
|
||||
exports[`can catch errors catchError in catchError 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
||||
|
||||
@@ -895,6 +878,7 @@ exports[`can catch errors catchError in catchError 2`] = `
|
||||
exports[`can catch errors catchError in catchError 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -909,6 +893,7 @@ exports[`can catch errors catchError in catchError 3`] = `
|
||||
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, markRaw, withKey } = helpers;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
@@ -937,6 +922,7 @@ exports[`can catch errors catching error, rethrow, render parent -- a main comp
|
||||
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -949,6 +935,7 @@ exports[`can catch errors catching error, rethrow, render parent -- a main comp
|
||||
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
||||
|
||||
@@ -961,6 +948,7 @@ exports[`can catch errors catching error, rethrow, render parent -- a main comp
|
||||
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -974,6 +962,7 @@ exports[`can catch errors catching error, rethrow, render parent -- a main comp
|
||||
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Sibling</div>\`);
|
||||
@@ -987,6 +976,7 @@ exports[`can catch errors catching error, rethrow, render parent -- a main comp
|
||||
exports[`can catch errors catching in child makes parent render 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, markRaw, withKey } = helpers;
|
||||
const comp1 = app.createComponent(null, false, false, false, false);
|
||||
@@ -1015,6 +1005,7 @@ exports[`can catch errors catching in child makes parent render 1`] = `
|
||||
exports[`can catch errors catching in child makes parent render 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -1027,6 +1018,7 @@ exports[`can catch errors catching in child makes parent render 2`] = `
|
||||
exports[`can catch errors catching in child makes parent render 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -1040,6 +1032,7 @@ exports[`can catch errors catching in child makes parent render 3`] = `
|
||||
exports[`can catch errors catching in child makes parent render 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -1054,6 +1047,7 @@ exports[`can catch errors catching in child makes parent render 4`] = `
|
||||
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`OK\`, true, false, false, true);
|
||||
@@ -1077,6 +1071,7 @@ exports[`can catch errors error in mounted on a component with a sibling (proper
|
||||
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -1088,6 +1083,7 @@ exports[`can catch errors error in mounted on a component with a sibling (proper
|
||||
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -1108,6 +1104,7 @@ exports[`can catch errors error in mounted on a component with a sibling (proper
|
||||
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>Some text</div>\`);
|
||||
@@ -1121,6 +1118,7 @@ exports[`can catch errors error in mounted on a component with a sibling (proper
|
||||
exports[`can catch errors onError in class inheritance is called if rethrown 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Concrete\`, true, false, false, true);
|
||||
|
||||
@@ -1133,6 +1131,7 @@ exports[`can catch errors onError in class inheritance is called if rethrown 1`]
|
||||
exports[`can catch errors onError in class inheritance is called if rethrown 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -1152,6 +1151,7 @@ exports[`can catch errors onError in class inheritance is called if rethrown 2`]
|
||||
exports[`can catch errors onError in class inheritance is not called if no rethrown 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Concrete\`, true, false, false, true);
|
||||
|
||||
@@ -1164,6 +1164,7 @@ exports[`can catch errors onError in class inheritance is not called if no rethr
|
||||
exports[`can catch errors onError in class inheritance is not called if no rethrown 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
||||
@@ -1183,6 +1184,7 @@ exports[`can catch errors onError in class inheritance is not called if no rethr
|
||||
exports[`errors and promises a rendering error in a sub component will reject the mount promise 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -1198,6 +1200,7 @@ exports[`errors and promises a rendering error in a sub component will reject th
|
||||
exports[`errors and promises a rendering error in a sub component will reject the mount promise 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -1212,6 +1215,7 @@ exports[`errors and promises a rendering error in a sub component will reject th
|
||||
exports[`errors and promises a rendering error will reject the mount promise 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -1226,6 +1230,7 @@ exports[`errors and promises a rendering error will reject the mount promise 1`]
|
||||
exports[`errors and promises a rendering error will reject the render promise (with sub components) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -1242,6 +1247,7 @@ exports[`errors and promises a rendering error will reject the render promise (w
|
||||
exports[`errors and promises a rendering error will reject the render promise (with sub components) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span/>\`);
|
||||
@@ -1255,6 +1261,7 @@ exports[`errors and promises a rendering error will reject the render promise (w
|
||||
exports[`errors and promises a rendering error will reject the render promise 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
@@ -1272,6 +1279,7 @@ exports[`errors and promises a rendering error will reject the render promise 1`
|
||||
exports[`errors and promises an error in mounted call will reject the mount promise 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>abc</div>\`);
|
||||
@@ -1285,6 +1293,7 @@ exports[`errors and promises an error in mounted call will reject the mount prom
|
||||
exports[`errors and promises an error in onMounted callback will have the component's setup in its stack trace 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>abc</div>\`);
|
||||
@@ -1298,6 +1307,7 @@ exports[`errors and promises an error in onMounted callback will have the compon
|
||||
exports[`errors and promises an error in patched call will reject the render promise 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -1312,6 +1322,7 @@ exports[`errors and promises an error in patched call will reject the render pro
|
||||
exports[`errors and promises an error in willPatch call will reject the render promise 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -1326,6 +1337,7 @@ exports[`errors and promises an error in willPatch call will reject the render p
|
||||
exports[`errors and promises errors in mounted and in willUnmount 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -1339,6 +1351,7 @@ exports[`errors and promises errors in mounted and in willUnmount 1`] = `
|
||||
exports[`errors and promises errors in onWillRender/onRender aren't wrapped more than once 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>abc</div>\`);
|
||||
@@ -1352,6 +1365,7 @@ exports[`errors and promises errors in onWillRender/onRender aren't wrapped more
|
||||
exports[`errors and promises errors in rerender 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -1362,16 +1376,3 @@ exports[`errors and promises errors in rerender 1`] = `
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`errors and promises wrapped errors in async code are correctly caught 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>abc</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return block1();
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`event handling Invalid handler throws an error 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">click</button>\`);
|
||||
@@ -17,6 +18,7 @@ exports[`event handling Invalid handler throws an error 1`] = `
|
||||
exports[`event handling handler is not called if component is destroyed 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span block-handler-0=\\"click\\"/>\`);
|
||||
@@ -31,6 +33,7 @@ exports[`event handling handler is not called if component is destroyed 1`] = `
|
||||
exports[`event handling handler receive the event as argument 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -48,6 +51,7 @@ exports[`event handling handler receive the event as argument 1`] = `
|
||||
exports[`event handling handler receive the event as argument 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>simple vnode</div>\`);
|
||||
@@ -58,23 +62,10 @@ exports[`event handling handler receive the event as argument 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`event handling handler works when app is mounted in an iframe 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span block-handler-0=\\"click\\">click me</span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [ctx['inc'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`event handling input blur event is not called if component is destroyed 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -93,6 +84,7 @@ exports[`event handling input blur event is not called if component is destroyed
|
||||
exports[`event handling input blur event is not called if component is destroyed 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input block-handler-0=\\"blur\\"/>\`);
|
||||
@@ -107,6 +99,7 @@ exports[`event handling input blur event is not called if component is destroyed
|
||||
exports[`event handling objects from scope are properly captured by t-on 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -133,6 +126,7 @@ exports[`event handling objects from scope are properly captured by t-on 1`] = `
|
||||
exports[`event handling support for callable expression in event handler 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><input type=\\"text\\" block-handler-1=\\"input\\"/></div>\`);
|
||||
@@ -148,6 +142,7 @@ exports[`event handling support for callable expression in event handler 1`] = `
|
||||
exports[`event handling t-on with handler bound to dynamic argument on a t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`basics basic use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -15,6 +16,7 @@ exports[`basics basic use 1`] = `
|
||||
exports[`basics basic use 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child<block-text-0/></span>\`);
|
||||
@@ -29,6 +31,7 @@ exports[`basics basic use 2`] = `
|
||||
exports[`basics can select a sub widget 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`OtherChild\`, true, false, false, true);
|
||||
@@ -49,6 +52,7 @@ exports[`basics can select a sub widget 1`] = `
|
||||
exports[`basics can select a sub widget 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>CHILD 1</span>\`);
|
||||
@@ -62,6 +66,7 @@ exports[`basics can select a sub widget 2`] = `
|
||||
exports[`basics can select a sub widget 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>CHILD 2</div>\`);
|
||||
@@ -75,6 +80,7 @@ exports[`basics can select a sub widget 3`] = `
|
||||
exports[`basics can select a sub widget, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`OtherChild\`, true, false, false, true);
|
||||
@@ -95,6 +101,7 @@ exports[`basics can select a sub widget, part 2 1`] = `
|
||||
exports[`basics can select a sub widget, part 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>CHILD 1</span>\`);
|
||||
@@ -108,6 +115,7 @@ exports[`basics can select a sub widget, part 2 2`] = `
|
||||
exports[`basics can select a sub widget, part 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>CHILD 2</div>\`);
|
||||
@@ -121,6 +129,7 @@ exports[`basics can select a sub widget, part 2 3`] = `
|
||||
exports[`basics sub widget is interactive 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -133,6 +142,7 @@ exports[`basics sub widget is interactive 1`] = `
|
||||
exports[`basics sub widget is interactive 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><button block-handler-0=\\"click\\">click</button>child<block-text-1/></span>\`);
|
||||
@@ -148,6 +158,7 @@ exports[`basics sub widget is interactive 2`] = `
|
||||
exports[`basics top level sub widget with a parent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, true);
|
||||
|
||||
@@ -163,6 +174,7 @@ exports[`basics top level sub widget with a parent 1`] = `
|
||||
exports[`basics top level sub widget with a parent 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, true);
|
||||
|
||||
@@ -175,6 +187,7 @@ exports[`basics top level sub widget with a parent 2`] = `
|
||||
exports[`basics top level sub widget with a parent 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>Hello</span>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`hooks autofocus hook input in a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><input block-ref=\\"0\\"/><block-child-0/></div>\`);
|
||||
@@ -24,6 +25,7 @@ exports[`hooks autofocus hook input in a t-if 1`] = `
|
||||
exports[`hooks autofocus hook simple input 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><input block-ref=\\"0\\"/><input block-ref=\\"1\\"/></div>\`);
|
||||
@@ -40,6 +42,7 @@ exports[`hooks autofocus hook simple input 1`] = `
|
||||
exports[`hooks can use onWillStart, onWillUpdateProps 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`MyComponent\`, true, false, false, false);
|
||||
|
||||
@@ -52,6 +55,7 @@ exports[`hooks can use onWillStart, onWillUpdateProps 1`] = `
|
||||
exports[`hooks can use onWillStart, onWillUpdateProps 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -66,6 +70,7 @@ exports[`hooks can use onWillStart, onWillUpdateProps 2`] = `
|
||||
exports[`hooks can use useComponent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -79,6 +84,7 @@ exports[`hooks can use useComponent 1`] = `
|
||||
exports[`hooks can use useEnv 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -93,6 +99,7 @@ exports[`hooks can use useEnv 1`] = `
|
||||
exports[`hooks mounted callbacks should be called in reverse order from willUnmount callbacks 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
@@ -107,6 +114,7 @@ exports[`hooks mounted callbacks should be called in reverse order from willUnmo
|
||||
exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -121,6 +129,7 @@ exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 1`] = `
|
||||
exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -139,6 +148,7 @@ exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 2`] = `
|
||||
exports[`hooks parent and child env (with useChildSubEnv) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -153,6 +163,7 @@ exports[`hooks parent and child env (with useChildSubEnv) 1`] = `
|
||||
exports[`hooks parent and child env (with useChildSubEnv) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -167,6 +178,7 @@ exports[`hooks parent and child env (with useChildSubEnv) 2`] = `
|
||||
exports[`hooks parent and child env (with useSubEnv) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -181,6 +193,7 @@ exports[`hooks parent and child env (with useSubEnv) 1`] = `
|
||||
exports[`hooks parent and child env (with useSubEnv) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -195,6 +208,7 @@ exports[`hooks parent and child env (with useSubEnv) 2`] = `
|
||||
exports[`hooks two different call to willPatch/patched should work 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
||||
@@ -209,6 +223,7 @@ exports[`hooks two different call to willPatch/patched should work 1`] = `
|
||||
exports[`hooks useChildSubEnv does not pollute user env 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -223,6 +238,7 @@ exports[`hooks useChildSubEnv does not pollute user env 1`] = `
|
||||
exports[`hooks useChildSubEnv supports arbitrary descriptor 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -235,6 +251,7 @@ exports[`hooks useChildSubEnv supports arbitrary descriptor 1`] = `
|
||||
exports[`hooks useChildSubEnv supports arbitrary descriptor 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
||||
@@ -250,6 +267,7 @@ exports[`hooks useChildSubEnv supports arbitrary descriptor 2`] = `
|
||||
exports[`hooks useEffect hook dependencies prevent effects from rerunning when unchanged 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -263,6 +281,7 @@ exports[`hooks useEffect hook dependencies prevent effects from rerunning when u
|
||||
exports[`hooks useEffect hook effect can depend on stuff in dom 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
@@ -282,6 +301,7 @@ exports[`hooks useEffect hook effect can depend on stuff in dom 1`] = `
|
||||
exports[`hooks useEffect hook effect runs on mount, is reapplied on patch, and is cleaned up on unmount and before reapplying 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -295,6 +315,7 @@ exports[`hooks useEffect hook effect runs on mount, is reapplied on patch, and i
|
||||
exports[`hooks useEffect hook effect with empty dependency list never reruns 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -309,6 +330,7 @@ exports[`hooks useEffect hook effect with empty dependency list never reruns 1`]
|
||||
exports[`hooks useEffect hook properly behaves when the effect function throws 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -322,6 +344,7 @@ exports[`hooks useEffect hook properly behaves when the effect function throws 1
|
||||
exports[`hooks useExternalListener 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`MyComponent\`, true, false, false, true);
|
||||
|
||||
@@ -338,6 +361,7 @@ exports[`hooks useExternalListener 1`] = `
|
||||
exports[`hooks useExternalListener 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -352,6 +376,7 @@ exports[`hooks useExternalListener 2`] = `
|
||||
exports[`hooks useRef hook: basic use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><button block-ref=\\"0\\"><block-text-1/></button></div>\`);
|
||||
@@ -368,6 +393,7 @@ exports[`hooks useRef hook: basic use 1`] = `
|
||||
exports[`hooks useSubEnv modifies user env 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -382,6 +408,7 @@ exports[`hooks useSubEnv modifies user env 1`] = `
|
||||
exports[`hooks useSubEnv supports arbitrary descriptor 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -394,6 +421,7 @@ exports[`hooks useSubEnv supports arbitrary descriptor 1`] = `
|
||||
exports[`hooks useSubEnv supports arbitrary descriptor 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`lifecycle hooks basic checks for a component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>test</span>\`);
|
||||
@@ -16,6 +17,7 @@ exports[`lifecycle hooks basic checks for a component 1`] = `
|
||||
exports[`lifecycle hooks component semantics 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`C\`, true, false, false, true);
|
||||
@@ -33,6 +35,7 @@ exports[`lifecycle hooks component semantics 1`] = `
|
||||
exports[`lifecycle hooks component semantics 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>B</div>\`);
|
||||
@@ -46,6 +49,7 @@ exports[`lifecycle hooks component semantics 2`] = `
|
||||
exports[`lifecycle hooks component semantics 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`D\`, true, false, false, true);
|
||||
const comp2 = app.createComponent(\`E\`, true, false, false, true);
|
||||
@@ -69,6 +73,7 @@ exports[`lifecycle hooks component semantics 3`] = `
|
||||
exports[`lifecycle hooks component semantics 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>D</div>\`);
|
||||
@@ -82,6 +87,7 @@ exports[`lifecycle hooks component semantics 4`] = `
|
||||
exports[`lifecycle hooks component semantics 5`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>E</div>\`);
|
||||
@@ -95,6 +101,7 @@ exports[`lifecycle hooks component semantics 5`] = `
|
||||
exports[`lifecycle hooks component semantics 6`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>F</div>\`);
|
||||
@@ -108,6 +115,7 @@ exports[`lifecycle hooks component semantics 6`] = `
|
||||
exports[`lifecycle hooks components are unmounted and destroyed if no longer in DOM, even after updateprops 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -127,6 +135,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
|
||||
exports[`lifecycle hooks components are unmounted and destroyed if no longer in DOM, even after updateprops 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -141,6 +150,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
|
||||
exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -157,6 +167,7 @@ exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM
|
||||
exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -170,6 +181,7 @@ exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM
|
||||
exports[`lifecycle hooks destroy new children before being mountged 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -188,6 +200,7 @@ exports[`lifecycle hooks destroy new children before being mountged 1`] = `
|
||||
exports[`lifecycle hooks destroy new children before being mountged 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -199,6 +212,7 @@ exports[`lifecycle hooks destroy new children before being mountged 2`] = `
|
||||
exports[`lifecycle hooks hooks are called in proper order in widget creation/destruction 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -214,6 +228,7 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des
|
||||
exports[`lifecycle hooks hooks are called in proper order in widget creation/destruction 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -227,6 +242,7 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des
|
||||
exports[`lifecycle hooks lifecycle callbacks are bound to component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Test\`, true, false, false, false);
|
||||
|
||||
@@ -239,6 +255,7 @@ exports[`lifecycle hooks lifecycle callbacks are bound to component 1`] = `
|
||||
exports[`lifecycle hooks lifecycle callbacks are bound to component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -250,6 +267,7 @@ exports[`lifecycle hooks lifecycle callbacks are bound to component 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -265,6 +283,7 @@ exports[`lifecycle hooks lifecycle semantics 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -278,6 +297,7 @@ exports[`lifecycle hooks lifecycle semantics 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -294,6 +314,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
||||
|
||||
@@ -306,6 +327,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -319,6 +341,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 3`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -335,6 +358,7 @@ exports[`lifecycle hooks lifecycle semantics, part 3 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 4 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -351,6 +375,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 4 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
|
||||
|
||||
@@ -363,6 +388,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 4 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -376,6 +402,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 3`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 5 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -392,6 +419,7 @@ exports[`lifecycle hooks lifecycle semantics, part 5 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 5 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -405,6 +433,7 @@ exports[`lifecycle hooks lifecycle semantics, part 5 2`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 6 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -417,6 +446,7 @@ exports[`lifecycle hooks lifecycle semantics, part 6 1`] = `
|
||||
exports[`lifecycle hooks lifecycle semantics, part 6 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -430,6 +460,7 @@ exports[`lifecycle hooks lifecycle semantics, part 6 2`] = `
|
||||
exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -443,6 +474,7 @@ exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = `
|
||||
exports[`lifecycle hooks mounted hook is called on every mount, not just the first one 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -459,6 +491,7 @@ exports[`lifecycle hooks mounted hook is called on every mount, not just the fir
|
||||
exports[`lifecycle hooks mounted hook is called on every mount, not just the first one 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child</div>\`);
|
||||
@@ -472,6 +505,7 @@ exports[`lifecycle hooks mounted hook is called on every mount, not just the fir
|
||||
exports[`lifecycle hooks mounted hook is called on subcomponents, in proper order 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -487,6 +521,7 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde
|
||||
exports[`lifecycle hooks mounted hook is called on subcomponents, in proper order 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -500,6 +535,7 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde
|
||||
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -518,6 +554,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
|
||||
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, true);
|
||||
|
||||
@@ -533,6 +570,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
|
||||
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -546,6 +584,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
|
||||
exports[`lifecycle hooks onWillRender 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -558,6 +597,7 @@ exports[`lifecycle hooks onWillRender 1`] = `
|
||||
exports[`lifecycle hooks onWillRender 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
|
||||
@@ -573,6 +613,7 @@ exports[`lifecycle hooks onWillRender 2`] = `
|
||||
exports[`lifecycle hooks patched hook is called after updateProps 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -588,6 +629,7 @@ exports[`lifecycle hooks patched hook is called after updateProps 1`] = `
|
||||
exports[`lifecycle hooks patched hook is called after updateProps 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -601,6 +643,7 @@ exports[`lifecycle hooks patched hook is called after updateProps 2`] = `
|
||||
exports[`lifecycle hooks patched hook is called after updating State 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -615,6 +658,7 @@ exports[`lifecycle hooks patched hook is called after updating State 1`] = `
|
||||
exports[`lifecycle hooks render in mounted 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -629,6 +673,7 @@ exports[`lifecycle hooks render in mounted 1`] = `
|
||||
exports[`lifecycle hooks render in patched 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -643,6 +688,7 @@ exports[`lifecycle hooks render in patched 1`] = `
|
||||
exports[`lifecycle hooks render in willPatch 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -657,6 +703,7 @@ exports[`lifecycle hooks render in willPatch 1`] = `
|
||||
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -673,6 +720,7 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle
|
||||
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -686,6 +734,7 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle
|
||||
exports[`lifecycle hooks timeout in onWillStart emits a warning 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span/>\`);
|
||||
@@ -699,12 +748,13 @@ exports[`lifecycle hooks timeout in onWillStart emits a warning 1`] = `
|
||||
exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const props1 = {prop: ctx['state'].prop};
|
||||
helpers.validateProps(\`Child\`, props1, this);
|
||||
helpers.validateProps(\`Child\`, props1, ctx);
|
||||
return comp1(props1, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
@@ -713,6 +763,7 @@ exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 1`] = `
|
||||
exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -724,6 +775,7 @@ exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 2`] = `
|
||||
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -739,6 +791,7 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
|
||||
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, false);
|
||||
|
||||
@@ -754,6 +807,7 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
|
||||
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -768,6 +822,7 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
|
||||
exports[`lifecycle hooks willStart hook is called on sub component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -780,6 +835,7 @@ exports[`lifecycle hooks willStart hook is called on sub component 1`] = `
|
||||
exports[`lifecycle hooks willStart hook is called on sub component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -793,6 +849,7 @@ exports[`lifecycle hooks willStart hook is called on sub component 2`] = `
|
||||
exports[`lifecycle hooks willStart is called 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -806,6 +863,7 @@ exports[`lifecycle hooks willStart is called 1`] = `
|
||||
exports[`lifecycle hooks willStart is called with component as this 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>simple vnode</span>\`);
|
||||
@@ -819,6 +877,7 @@ exports[`lifecycle hooks willStart is called with component as this 1`] = `
|
||||
exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is mounted in some other position 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -840,6 +899,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
|
||||
exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is mounted in some other position 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -853,6 +913,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
|
||||
exports[`lifecycle hooks willUpdateProps hook is called 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -865,6 +926,7 @@ exports[`lifecycle hooks willUpdateProps hook is called 1`] = `
|
||||
exports[`lifecycle hooks willUpdateProps hook is called 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`basics accept ES6-like syntax for props (with getters) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -18,6 +19,7 @@ exports[`basics accept ES6-like syntax for props (with getters) 1`] = `
|
||||
exports[`basics accept ES6-like syntax for props (with getters) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -32,6 +34,7 @@ exports[`basics accept ES6-like syntax for props (with getters) 2`] = `
|
||||
exports[`basics arrow functions as prop correctly capture their scope 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -54,6 +57,7 @@ exports[`basics arrow functions as prop correctly capture their scope 1`] = `
|
||||
exports[`basics arrow functions as prop correctly capture their scope 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"/>\`);
|
||||
@@ -68,6 +72,7 @@ exports[`basics arrow functions as prop correctly capture their scope 2`] = `
|
||||
exports[`basics explicit object prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -83,6 +88,7 @@ exports[`basics explicit object prop 1`] = `
|
||||
exports[`basics explicit object prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -97,6 +103,7 @@ exports[`basics explicit object prop 2`] = `
|
||||
exports[`basics prop names can contain - 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -109,6 +116,7 @@ exports[`basics prop names can contain - 1`] = `
|
||||
exports[`basics prop names can contain - 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -123,6 +131,7 @@ exports[`basics prop names can contain - 2`] = `
|
||||
exports[`basics support prop names that aren't valid bare object property names 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -135,6 +144,7 @@ exports[`basics support prop names that aren't valid bare object property names
|
||||
exports[`basics support prop names that aren't valid bare object property names 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\"/>\`);
|
||||
@@ -149,6 +159,7 @@ exports[`basics support prop names that aren't valid bare object property names
|
||||
exports[`basics t-set with a body expression can be passed in props, and then t-out 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -163,7 +174,7 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`abc\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`abc\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b3 = comp1({val: ctx['abc']}, key + \`__1\`, node, this, null);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
@@ -173,6 +184,7 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
|
||||
exports[`basics t-set with a body expression can be passed in props, and then t-out 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { safeOutput } = helpers;
|
||||
|
||||
@@ -189,6 +201,7 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
|
||||
exports[`basics t-set with a body expression can be used as textual prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -208,6 +221,7 @@ exports[`basics t-set with a body expression can be used as textual prop 1`] = `
|
||||
exports[`basics t-set with a body expression can be used as textual prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -222,6 +236,7 @@ exports[`basics t-set with a body expression can be used as textual prop 2`] = `
|
||||
exports[`basics t-set works 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -241,6 +256,7 @@ exports[`basics t-set works 1`] = `
|
||||
exports[`basics t-set works 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -255,6 +271,7 @@ exports[`basics t-set works 2`] = `
|
||||
exports[`basics template string in prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -267,6 +284,7 @@ exports[`basics template string in prop 1`] = `
|
||||
exports[`basics template string in prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -278,6 +296,7 @@ exports[`basics template string in prop 2`] = `
|
||||
exports[`bound functions is referentially equal after update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { bind } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -291,6 +310,7 @@ exports[`bound functions is referentially equal after update 1`] = `
|
||||
exports[`bound functions is referentially equal after update 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -302,6 +322,7 @@ exports[`bound functions is referentially equal after update 2`] = `
|
||||
exports[`can bind function prop with bind suffix 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { bind } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -315,6 +336,7 @@ exports[`can bind function prop with bind suffix 1`] = `
|
||||
exports[`can bind function prop with bind suffix 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
||||
exports[`reactivity in lifecycle Child component doesn't render when state they depend on changes but their parent is about to unmount them 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -19,6 +20,7 @@ exports[`reactivity in lifecycle Child component doesn't render when state they
|
||||
exports[`reactivity in lifecycle Child component doesn't render when state they depend on changes but their parent is about to unmount them 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -30,6 +32,7 @@ exports[`reactivity in lifecycle Child component doesn't render when state they
|
||||
exports[`reactivity in lifecycle Component is automatically subscribed to reactive object received as prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -42,6 +45,7 @@ exports[`reactivity in lifecycle Component is automatically subscribed to reacti
|
||||
exports[`reactivity in lifecycle Component is automatically subscribed to reactive object received as prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -55,6 +59,7 @@ exports[`reactivity in lifecycle Component is automatically subscribed to reacti
|
||||
exports[`reactivity in lifecycle can use a state hook 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -69,6 +74,7 @@ exports[`reactivity in lifecycle can use a state hook 1`] = `
|
||||
exports[`reactivity in lifecycle can use a state hook 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -83,6 +89,7 @@ exports[`reactivity in lifecycle can use a state hook 2 1`] = `
|
||||
exports[`reactivity in lifecycle can use a state hook on Map 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -97,6 +104,7 @@ exports[`reactivity in lifecycle can use a state hook on Map 1`] = `
|
||||
exports[`reactivity in lifecycle change state while mounting component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -111,6 +119,7 @@ exports[`reactivity in lifecycle change state while mounting component 1`] = `
|
||||
exports[`reactivity in lifecycle state changes in willUnmount do not trigger rerender 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -129,6 +138,7 @@ exports[`reactivity in lifecycle state changes in willUnmount do not trigger rer
|
||||
exports[`reactivity in lifecycle state changes in willUnmount do not trigger rerender 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`refs basic use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
||||
@@ -18,6 +19,7 @@ exports[`refs basic use 1`] = `
|
||||
exports[`refs can use 2 refs with same name in a t-if/t-else situation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { multiRefSetter } = helpers;
|
||||
|
||||
@@ -41,6 +43,7 @@ exports[`refs can use 2 refs with same name in a t-if/t-else situation 1`] = `
|
||||
exports[`refs refs and recursive templates 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Test\`, true, false, false, false);
|
||||
|
||||
@@ -62,6 +65,7 @@ exports[`refs refs and recursive templates 1`] = `
|
||||
exports[`refs refs are properly bound in slots 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
|
||||
@@ -88,6 +92,7 @@ exports[`refs refs are properly bound in slots 1`] = `
|
||||
exports[`refs refs are properly bound in slots 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -103,6 +108,7 @@ exports[`refs refs are properly bound in slots 2`] = `
|
||||
exports[`refs throws if there are 2 same refs at the same time 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { multiRefSetter } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`children, default props and renderings 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -17,6 +18,7 @@ exports[`children, default props and renderings 1`] = `
|
||||
exports[`children, default props and renderings 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -28,6 +30,7 @@ exports[`children, default props and renderings 2`] = `
|
||||
exports[`force render in case of existing render 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -40,6 +43,7 @@ exports[`force render in case of existing render 1`] = `
|
||||
exports[`force render in case of existing render 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
|
||||
@@ -54,6 +58,7 @@ exports[`force render in case of existing render 2`] = `
|
||||
exports[`force render in case of existing render 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -65,6 +70,7 @@ exports[`force render in case of existing render 3`] = `
|
||||
exports[`rendering semantics can force a render to update sub tree 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -79,6 +85,7 @@ exports[`rendering semantics can force a render to update sub tree 1`] = `
|
||||
exports[`rendering semantics can force a render to update sub tree 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -90,6 +97,7 @@ exports[`rendering semantics can force a render to update sub tree 2`] = `
|
||||
exports[`rendering semantics can render a parent without rendering child 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -104,6 +112,7 @@ exports[`rendering semantics can render a parent without rendering child 1`] = `
|
||||
exports[`rendering semantics can render a parent without rendering child 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -115,6 +124,7 @@ exports[`rendering semantics can render a parent without rendering child 2`] = `
|
||||
exports[`rendering semantics props are reactive (nested prop) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -127,6 +137,7 @@ exports[`rendering semantics props are reactive (nested prop) 1`] = `
|
||||
exports[`rendering semantics props are reactive (nested prop) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -138,6 +149,7 @@ exports[`rendering semantics props are reactive (nested prop) 2`] = `
|
||||
exports[`rendering semantics props are reactive 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -150,6 +162,7 @@ exports[`rendering semantics props are reactive 1`] = `
|
||||
exports[`rendering semantics props are reactive 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -161,6 +174,7 @@ exports[`rendering semantics props are reactive 2`] = `
|
||||
exports[`rendering semantics render need a boolean = true to be 'deep' 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -175,6 +189,7 @@ exports[`rendering semantics render need a boolean = true to be 'deep' 1`] = `
|
||||
exports[`rendering semantics render need a boolean = true to be 'deep' 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -186,6 +201,7 @@ exports[`rendering semantics render need a boolean = true to be 'deep' 2`] = `
|
||||
exports[`rendering semantics render with deep=true followed by render with deep=false work as expected 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -201,6 +217,7 @@ exports[`rendering semantics render with deep=true followed by render with deep=
|
||||
exports[`rendering semantics render with deep=true followed by render with deep=false work as expected 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -214,6 +231,7 @@ exports[`rendering semantics render with deep=true followed by render with deep=
|
||||
exports[`rendering semantics rendering is atomic (for one subtree) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`B\`, true, false, false, false);
|
||||
|
||||
@@ -228,6 +246,7 @@ exports[`rendering semantics rendering is atomic (for one subtree) 1`] = `
|
||||
exports[`rendering semantics rendering is atomic (for one subtree) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, false);
|
||||
|
||||
@@ -240,6 +259,7 @@ exports[`rendering semantics rendering is atomic (for one subtree) 2`] = `
|
||||
exports[`rendering semantics rendering is atomic (for one subtree) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -251,6 +271,7 @@ exports[`rendering semantics rendering is atomic (for one subtree) 3`] = `
|
||||
exports[`rendering semantics works as expected for dynamic number of props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
@@ -263,6 +284,7 @@ exports[`rendering semantics works as expected for dynamic number of props 1`] =
|
||||
exports[`rendering semantics works as expected for dynamic number of props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
||||
exports[`style and class handling can set class on multi root component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -15,6 +16,7 @@ exports[`style and class handling can set class on multi root component 1`] = `
|
||||
exports[`style and class handling can set class on multi root component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block2 = createBlock(\`<div>a</div>\`);
|
||||
@@ -32,6 +34,7 @@ exports[`style and class handling can set class on multi root component 2`] = `
|
||||
exports[`style and class handling can set class on sub component, as prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -44,6 +47,7 @@ exports[`style and class handling can set class on sub component, as prop 1`] =
|
||||
exports[`style and class handling can set class on sub component, as prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
@@ -58,6 +62,7 @@ exports[`style and class handling can set class on sub component, as prop 2`] =
|
||||
exports[`style and class handling can set class on sub sub component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -70,6 +75,7 @@ exports[`style and class handling can set class on sub sub component 1`] = `
|
||||
exports[`style and class handling can set class on sub sub component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, false);
|
||||
|
||||
@@ -82,6 +88,7 @@ exports[`style and class handling can set class on sub sub component 2`] = `
|
||||
exports[`style and class handling can set class on sub sub component 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">childchild</div>\`);
|
||||
@@ -96,6 +103,7 @@ exports[`style and class handling can set class on sub sub component 3`] = `
|
||||
exports[`style and class handling can set more than one class on sub component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -108,6 +116,7 @@ exports[`style and class handling can set more than one class on sub component 1
|
||||
exports[`style and class handling can set more than one class on sub component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
@@ -122,6 +131,7 @@ exports[`style and class handling can set more than one class on sub component 2
|
||||
exports[`style and class handling can set style and class inside component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div style=\\"font-weight:bold;\\" class=\\"some-class\\">world</div>\`);
|
||||
@@ -135,6 +145,7 @@ exports[`style and class handling can set style and class inside component 1`] =
|
||||
exports[`style and class handling class on components do not interfere with user defined classes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -149,6 +160,7 @@ exports[`style and class handling class on components do not interfere with user
|
||||
exports[`style and class handling class on sub component, which is switched to another 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -161,6 +173,7 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
exports[`style and class handling class on sub component, which is switched to another 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`ChildB\`, true, false, false, false);
|
||||
@@ -180,6 +193,7 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
exports[`style and class handling class on sub component, which is switched to another 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">a</div>\`);
|
||||
@@ -194,6 +208,7 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
exports[`style and class handling class on sub component, which is switched to another 4`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span block-attribute-0=\\"class\\">b</span>\`);
|
||||
@@ -208,6 +223,7 @@ exports[`style and class handling class on sub component, which is switched to a
|
||||
exports[`style and class handling class with extra whitespaces (variation) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -223,6 +239,7 @@ exports[`style and class handling class with extra whitespaces (variation) 1`] =
|
||||
exports[`style and class handling class with extra whitespaces (variation) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -237,6 +254,7 @@ exports[`style and class handling class with extra whitespaces (variation) 2`] =
|
||||
exports[`style and class handling class with extra whitespaces 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -249,6 +267,7 @@ exports[`style and class handling class with extra whitespaces 1`] = `
|
||||
exports[`style and class handling class with extra whitespaces 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -263,6 +282,7 @@ exports[`style and class handling class with extra whitespaces 2`] = `
|
||||
exports[`style and class handling component class and parent class combine together 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -275,6 +295,7 @@ exports[`style and class handling component class and parent class combine toget
|
||||
exports[`style and class handling component class and parent class combine together 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div class=\\"child\\" block-attribute-0=\\"class\\">child</div>\`);
|
||||
@@ -316,6 +337,7 @@ exports[`style and class handling dynamic t-att-style is properly added and upda
|
||||
exports[`style and class handling empty class attribute is not added on widget root el 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -331,6 +353,7 @@ exports[`style and class handling empty class attribute is not added on widget r
|
||||
exports[`style and class handling empty class attribute is not added on widget root el 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -345,6 +368,7 @@ exports[`style and class handling empty class attribute is not added on widget r
|
||||
exports[`style and class handling error in subcomponent with class 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -357,6 +381,7 @@ exports[`style and class handling error in subcomponent with class 1`] = `
|
||||
exports[`style and class handling error in subcomponent with class 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"><block-text-1/></div>\`);
|
||||
@@ -372,6 +397,7 @@ exports[`style and class handling error in subcomponent with class 2`] = `
|
||||
exports[`style and class handling no class is set is child ignores it 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -384,6 +410,7 @@ exports[`style and class handling no class is set is child ignores it 1`] = `
|
||||
exports[`style and class handling no class is set is child ignores it 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child</div>\`);
|
||||
@@ -397,6 +424,7 @@ exports[`style and class handling no class is set is child ignores it 2`] = `
|
||||
exports[`style and class handling no class is set is parent does not give it as prop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -409,6 +437,7 @@ exports[`style and class handling no class is set is parent does not give it as
|
||||
exports[`style and class handling no class is set is parent does not give it as prop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
|
||||
@@ -423,6 +452,7 @@ exports[`style and class handling no class is set is parent does not give it as
|
||||
exports[`style and class handling style is properly added on widget root el 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -435,6 +465,7 @@ exports[`style and class handling style is properly added on widget root el 1`]
|
||||
exports[`style and class handling style is properly added on widget root el 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"style\\"/>\`);
|
||||
@@ -449,6 +480,7 @@ exports[`style and class handling style is properly added on widget root el 2`]
|
||||
exports[`style and class handling t-att-class is properly added/removed on widget root el (v2) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -464,6 +496,7 @@ exports[`style and class handling t-att-class is properly added/removed on widge
|
||||
exports[`style and class handling t-att-class is properly added/removed on widget root el (v2) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
|
||||
@@ -478,6 +511,7 @@ exports[`style and class handling t-att-class is properly added/removed on widge
|
||||
exports[`style and class handling t-att-class is properly added/removed on widget root el (v3) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -490,6 +524,7 @@ exports[`style and class handling t-att-class is properly added/removed on widge
|
||||
exports[`style and class handling t-att-class is properly added/removed on widget root el (v3) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-call dynamic t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, zero } = helpers;
|
||||
const call = app.callTemplate.bind(app);
|
||||
@@ -21,6 +22,7 @@ exports[`t-call dynamic t-call 1`] = `
|
||||
exports[`t-call dynamic t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>foo</div>\`);
|
||||
@@ -34,6 +36,7 @@ exports[`t-call dynamic t-call 2`] = `
|
||||
exports[`t-call dynamic t-call 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -45,6 +48,7 @@ exports[`t-call dynamic t-call 3`] = `
|
||||
exports[`t-call dynamic t-call: key is propagated 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
const call = app.callTemplate.bind(app);
|
||||
@@ -61,6 +65,7 @@ exports[`t-call dynamic t-call: key is propagated 1`] = `
|
||||
exports[`t-call dynamic t-call: key is propagated 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"id\\"/>\`);
|
||||
@@ -75,6 +80,7 @@ exports[`t-call dynamic t-call: key is propagated 2`] = `
|
||||
exports[`t-call dynamic t-call: key is propagated 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -87,6 +93,7 @@ exports[`t-call dynamic t-call: key is propagated 3`] = `
|
||||
exports[`t-call handlers are properly bound through a dynamic t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const call = app.callTemplate.bind(app);
|
||||
|
||||
@@ -104,6 +111,7 @@ exports[`t-call handlers are properly bound through a dynamic t-call 1`] = `
|
||||
exports[`t-call handlers are properly bound through a dynamic t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
@@ -118,6 +126,7 @@ exports[`t-call handlers are properly bound through a dynamic t-call 2`] = `
|
||||
exports[`t-call handlers are properly bound through a t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
@@ -134,6 +143,7 @@ exports[`t-call handlers are properly bound through a t-call 1`] = `
|
||||
exports[`t-call handlers are properly bound through a t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
@@ -148,6 +158,7 @@ exports[`t-call handlers are properly bound through a t-call 2`] = `
|
||||
exports[`t-call handlers with arguments are properly bound through a t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
@@ -163,6 +174,7 @@ exports[`t-call handlers with arguments are properly bound through a t-call 1`]
|
||||
exports[`t-call handlers with arguments are properly bound through a t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
@@ -178,6 +190,7 @@ exports[`t-call handlers with arguments are properly bound through a t-call 2`]
|
||||
exports[`t-call parent is set within t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
@@ -193,6 +206,7 @@ exports[`t-call parent is set within t-call 1`] = `
|
||||
exports[`t-call parent is set within t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -205,6 +219,7 @@ exports[`t-call parent is set within t-call 2`] = `
|
||||
exports[`t-call parent is set within t-call 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>lucas</span>\`);
|
||||
@@ -218,6 +233,7 @@ exports[`t-call parent is set within t-call 3`] = `
|
||||
exports[`t-call parent is set within t-call with no parentNode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
|
||||
@@ -230,6 +246,7 @@ exports[`t-call parent is set within t-call with no parentNode 1`] = `
|
||||
exports[`t-call parent is set within t-call with no parentNode 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -242,6 +259,7 @@ exports[`t-call parent is set within t-call with no parentNode 2`] = `
|
||||
exports[`t-call parent is set within t-call with no parentNode 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>lucas</span>\`);
|
||||
@@ -255,6 +273,7 @@ exports[`t-call parent is set within t-call with no parentNode 3`] = `
|
||||
exports[`t-call recursive t-call binding this -- static t-call 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`recursive\`);
|
||||
@@ -276,6 +295,7 @@ exports[`t-call recursive t-call binding this -- static t-call 1`] = `
|
||||
exports[`t-call recursive t-call binding this -- static t-call 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`recursive\`);
|
||||
@@ -305,6 +325,7 @@ exports[`t-call recursive t-call binding this -- static t-call 2`] = `
|
||||
exports[`t-call sub components in two t-calls 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`sub\`);
|
||||
const callTemplate_2 = app.getTemplate(\`sub\`);
|
||||
@@ -327,6 +348,7 @@ exports[`t-call sub components in two t-calls 1`] = `
|
||||
exports[`t-call sub components in two t-calls 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -339,6 +361,7 @@ exports[`t-call sub components in two t-calls 2`] = `
|
||||
exports[`t-call sub components in two t-calls 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -353,6 +376,7 @@ exports[`t-call sub components in two t-calls 3`] = `
|
||||
exports[`t-call t-call in t-foreach and children component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`__template__999\`);
|
||||
@@ -380,6 +404,7 @@ exports[`t-call t-call in t-foreach and children component 1`] = `
|
||||
exports[`t-call t-call in t-foreach and children component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -392,6 +417,7 @@ exports[`t-call t-call in t-foreach and children component 2`] = `
|
||||
exports[`t-call t-call in t-foreach and children component 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -406,6 +432,7 @@ exports[`t-call t-call in t-foreach and children component 3`] = `
|
||||
exports[`t-call t-call with t-call-context and subcomponent 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
|
||||
|
||||
@@ -419,6 +446,7 @@ exports[`t-call t-call with t-call-context and subcomponent 1`] = `
|
||||
exports[`t-call t-call with t-call-context and subcomponent 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -434,51 +462,7 @@ exports[`t-call t-call with t-call-context and subcomponent 2`] = `
|
||||
exports[`t-call t-call with t-call-context and subcomponent 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = text(\`child\`);
|
||||
const b3 = text(ctx['props'].name);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call t-call with t-call-context and subcomponent, in dev mode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let ctx1 = ctx['subctx'];
|
||||
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call t-call with t-call-context and subcomponent, in dev mode 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const props1 = {name: ctx['aab']};
|
||||
helpers.validateProps(\`Child\`, props1, this);
|
||||
const b2 = comp1(props1, key + \`__1\`, node, this, null);
|
||||
const props2 = {name: ctx['lpe']};
|
||||
helpers.validateProps(\`Child\`, props2, this);
|
||||
const b3 = comp2(props2, key + \`__2\`, node, this, null);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call t-call with t-call-context and subcomponent, in dev mode 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -492,6 +476,7 @@ exports[`t-call t-call with t-call-context and subcomponent, in dev mode 3`] = `
|
||||
exports[`t-call t-call with t-call-context, simple use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
|
||||
|
||||
@@ -505,6 +490,7 @@ exports[`t-call t-call with t-call-context, simple use 1`] = `
|
||||
exports[`t-call t-call with t-call-context, simple use 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-call-block simple t-call-block with static text 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-component can switch between dynamic components without the need for a t-key 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -19,6 +20,7 @@ exports[`t-component can switch between dynamic components without the need for
|
||||
exports[`t-component can switch between dynamic components without the need for a t-key 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child a</span>\`);
|
||||
@@ -32,6 +34,7 @@ exports[`t-component can switch between dynamic components without the need for
|
||||
exports[`t-component can switch between dynamic components without the need for a t-key 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child b</span>\`);
|
||||
@@ -45,6 +48,7 @@ exports[`t-component can switch between dynamic components without the need for
|
||||
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -59,6 +63,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
|
||||
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child a</span>\`);
|
||||
@@ -72,6 +77,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
|
||||
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child b</div>\`);
|
||||
@@ -85,6 +91,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
|
||||
exports[`t-component can use dynamic components (the class) if given 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -99,6 +106,7 @@ exports[`t-component can use dynamic components (the class) if given 1`] = `
|
||||
exports[`t-component can use dynamic components (the class) if given 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child a</span>\`);
|
||||
@@ -112,6 +120,7 @@ exports[`t-component can use dynamic components (the class) if given 2`] = `
|
||||
exports[`t-component can use dynamic components (the class) if given 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>child b</span>\`);
|
||||
@@ -125,6 +134,7 @@ exports[`t-component can use dynamic components (the class) if given 3`] = `
|
||||
exports[`t-component modifying a sub widget 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -141,6 +151,7 @@ exports[`t-component modifying a sub widget 1`] = `
|
||||
exports[`t-component modifying a sub widget 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
|
||||
@@ -157,6 +168,7 @@ exports[`t-component modifying a sub widget 2`] = `
|
||||
exports[`t-component switching dynamic component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -170,6 +182,7 @@ exports[`t-component switching dynamic component 1`] = `
|
||||
exports[`t-component switching dynamic component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child a</div>\`);
|
||||
@@ -183,6 +196,7 @@ exports[`t-component switching dynamic component 2`] = `
|
||||
exports[`t-component switching dynamic component 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -194,6 +208,7 @@ exports[`t-component switching dynamic component 3`] = `
|
||||
exports[`t-component t-component works in simple case 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(null, false, false, false, true);
|
||||
|
||||
@@ -207,6 +222,7 @@ exports[`t-component t-component works in simple case 1`] = `
|
||||
exports[`t-component t-component works in simple case 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div>child</div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`list of components components in a node in a t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -28,6 +29,7 @@ exports[`list of components components in a node in a t-foreach 1`] = `
|
||||
exports[`list of components components in a node in a t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -42,8 +44,9 @@ exports[`list of components components in a node in a t-foreach 2`] = `
|
||||
exports[`list of components crash on duplicate key in dev mode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, OwlError, withKey } = helpers;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -53,10 +56,10 @@ exports[`list of components crash on duplicate key in dev mode 1`] = `
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`item\`] = v_block1[i1];
|
||||
const key1 = 'child';
|
||||
if (keys1.has(String(key1))) { throw new OwlError(\`Got duplicate key in t-foreach: \${key1}\`)}
|
||||
keys1.add(String(key1));
|
||||
if (keys1.has(key1)) { throw new Error(\`Got duplicate key in t-foreach: \${key1}\`)}
|
||||
keys1.add(key1);
|
||||
const props1 = {};
|
||||
helpers.validateProps(\`Child\`, props1, this);
|
||||
helpers.validateProps(\`Child\`, props1, ctx);
|
||||
c_block1[i1] = withKey(comp1(props1, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
return list(c_block1);
|
||||
@@ -67,42 +70,7 @@ exports[`list of components crash on duplicate key in dev mode 1`] = `
|
||||
exports[`list of components crash on duplicate key in dev mode 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(\`\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`list of components crash when using object as keys that serialize to the same string 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, OwlError, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList([{},{}]);;
|
||||
const keys1 = new Set();
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`item\`] = v_block1[i1];
|
||||
const key1 = ctx['item'];
|
||||
if (keys1.has(String(key1))) { throw new OwlError(\`Got duplicate key in t-foreach: \${key1}\`)}
|
||||
keys1.add(String(key1));
|
||||
const props1 = {};
|
||||
helpers.validateProps(\`Child\`, props1, this);
|
||||
c_block1[i1] = withKey(comp1(props1, key + \`__1__\${key1}\`, node, this, null), key1);
|
||||
}
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`list of components crash when using object as keys that serialize to the same string 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -114,6 +82,7 @@ exports[`list of components crash when using object as keys that serialize to th
|
||||
exports[`list of components list of sub components inside other nodes 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`SubComponent\`, true, false, false, true);
|
||||
@@ -139,6 +108,7 @@ exports[`list of components list of sub components inside other nodes 1`] = `
|
||||
exports[`list of components list of sub components inside other nodes 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span>asdf</span>\`);
|
||||
@@ -149,61 +119,10 @@ exports[`list of components list of sub components inside other nodes 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`list of components order is correct when slots are not of same type 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
||||
|
||||
let block2 = createBlock(\`<div>A</div>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
let b2;
|
||||
if (!ctx['state'].active) {
|
||||
b2 = block2();
|
||||
}
|
||||
return multi([b2]);
|
||||
}
|
||||
|
||||
function slot2(ctx, node, key = \\"\\") {
|
||||
return text(\`B\`);
|
||||
}
|
||||
|
||||
function slot3(ctx, node, key = \\"\\") {
|
||||
return text(\`C\`);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const ctx1 = capture(ctx);
|
||||
return comp1({slots: markRaw({'a': {__render: slot1, __ctx: ctx1, active: !ctx['state'].active}, 'b': {__render: slot2, __ctx: ctx1, active: true}, 'c': {__render: slot3, __ctx: ctx1, active: ctx['state'].active}})}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`list of components order is correct when slots are not of same type 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, callSlot, withKey } = helpers;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['slotNames']);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`slotName\`] = v_block1[i1];
|
||||
const key1 = ctx['slotName'];
|
||||
const slot1 = (ctx['slotName']);
|
||||
c_block1[i1] = withKey(toggler(slot1, callSlot(ctx, node, key1 + \`__1__\${key1}\`, slot1, true, {})), key1);
|
||||
}
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`list of components reconciliation alg works for t-foreach in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -237,6 +156,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
|
||||
exports[`list of components reconciliation alg works for t-foreach in t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -251,6 +171,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
|
||||
exports[`list of components reconciliation alg works for t-foreach in t-foreach, 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -286,6 +207,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
|
||||
exports[`list of components reconciliation alg works for t-foreach in t-foreach, 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -300,6 +222,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
|
||||
exports[`list of components simple list 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -320,6 +243,7 @@ exports[`list of components simple list 1`] = `
|
||||
exports[`list of components simple list 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -334,6 +258,7 @@ exports[`list of components simple list 2`] = `
|
||||
exports[`list of components sub components rendered in a loop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -357,6 +282,7 @@ exports[`list of components sub components rendered in a loop 1`] = `
|
||||
exports[`list of components sub components rendered in a loop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
@@ -371,6 +297,7 @@ exports[`list of components sub components rendered in a loop 2`] = `
|
||||
exports[`list of components sub components with some state rendered in a loop 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -394,6 +321,7 @@ exports[`list of components sub components with some state rendered in a loop 1`
|
||||
exports[`list of components sub components with some state rendered in a loop 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
@@ -408,6 +336,7 @@ exports[`list of components sub components with some state rendered in a loop 2`
|
||||
exports[`list of components switch component position 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -431,6 +360,7 @@ exports[`list of components switch component position 1`] = `
|
||||
exports[`list of components switch component position 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -445,6 +375,7 @@ exports[`list of components switch component position 2`] = `
|
||||
exports[`list of components t-foreach with t-component, and update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -469,6 +400,7 @@ exports[`list of components t-foreach with t-component, and update 1`] = `
|
||||
exports[`list of components t-foreach with t-component, and update 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-key t-foreach with t-key switch component position 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -27,6 +28,7 @@ exports[`t-key t-foreach with t-key switch component position 1`] = `
|
||||
exports[`t-key t-foreach with t-key switch component position 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -41,6 +43,7 @@ exports[`t-key t-foreach with t-key switch component position 2`] = `
|
||||
exports[`t-key t-key on Component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -54,6 +57,7 @@ exports[`t-key t-key on Component 1`] = `
|
||||
exports[`t-key t-key on Component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -68,6 +72,7 @@ exports[`t-key t-key on Component 2`] = `
|
||||
exports[`t-key t-key on Component as a function 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -84,6 +89,7 @@ exports[`t-key t-key on Component as a function 1`] = `
|
||||
exports[`t-key t-key on Component as a function 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -98,6 +104,7 @@ exports[`t-key t-key on Component as a function 2`] = `
|
||||
exports[`t-key t-key on multiple Components 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -117,6 +124,7 @@ exports[`t-key t-key on multiple Components 1`] = `
|
||||
exports[`t-key t-key on multiple Components 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -131,6 +139,7 @@ exports[`t-key t-key on multiple Components 2`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
|
||||
@@ -158,6 +167,7 @@ exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 1 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
|
||||
@@ -171,6 +181,7 @@ exports[`t-key t-key on multiple Components with t-call 1 2`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -185,6 +196,7 @@ exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
|
||||
|
||||
@@ -200,6 +212,7 @@ exports[`t-key t-key on multiple Components with t-call 2 1`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 2 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -217,6 +230,7 @@ exports[`t-key t-key on multiple Components with t-call 2 2`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 2 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-model directive .lazy modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -22,6 +23,7 @@ exports[`t-model directive .lazy modifier 1`] = `
|
||||
exports[`t-model directive .number modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -41,6 +43,7 @@ exports[`t-model directive .number modifier 1`] = `
|
||||
exports[`t-model directive .trim modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -60,6 +63,7 @@ exports[`t-model directive .trim modifier 1`] = `
|
||||
exports[`t-model directive basic use, on an input 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -79,6 +83,7 @@ exports[`t-model directive basic use, on an input 1`] = `
|
||||
exports[`t-model directive basic use, on an input with bracket expression 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -98,6 +103,7 @@ exports[`t-model directive basic use, on an input with bracket expression 1`] =
|
||||
exports[`t-model directive basic use, on another key in component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -117,6 +123,7 @@ exports[`t-model directive basic use, on another key in component 1`] = `
|
||||
exports[`t-model directive can also define t-on directive on same event, part 1 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -136,6 +143,7 @@ exports[`t-model directive can also define t-on directive on same event, part 1
|
||||
exports[`t-model directive can also define t-on directive on same event, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -165,6 +173,7 @@ exports[`t-model directive can also define t-on directive on same event, part 2
|
||||
exports[`t-model directive following a scope protecting directive (e.g. t-set) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, toNumber } = helpers;
|
||||
|
||||
@@ -186,6 +195,7 @@ exports[`t-model directive following a scope protecting directive (e.g. t-set) 1
|
||||
exports[`t-model directive in a t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, toNumber, withKey } = helpers;
|
||||
|
||||
@@ -213,6 +223,7 @@ exports[`t-model directive in a t-foreach 1`] = `
|
||||
exports[`t-model directive in a t-foreach, part 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, toNumber, withKey } = helpers;
|
||||
|
||||
@@ -241,6 +252,7 @@ exports[`t-model directive in a t-foreach, part 2 1`] = `
|
||||
exports[`t-model directive in a t-foreach, part 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, toNumber, withKey } = helpers;
|
||||
|
||||
@@ -269,6 +281,7 @@ exports[`t-model directive in a t-foreach, part 3 1`] = `
|
||||
exports[`t-model directive on a select 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -288,6 +301,7 @@ exports[`t-model directive on a select 1`] = `
|
||||
exports[`t-model directive on a select, initial state 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -306,6 +320,7 @@ exports[`t-model directive on a select, initial state 1`] = `
|
||||
exports[`t-model directive on a sub state key 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -325,6 +340,7 @@ exports[`t-model directive on a sub state key 1`] = `
|
||||
exports[`t-model directive on an input type=radio 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -348,6 +364,7 @@ exports[`t-model directive on an input type=radio 1`] = `
|
||||
exports[`t-model directive on an input type=radio, with initial value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -370,6 +387,7 @@ exports[`t-model directive on an input type=radio, with initial value 1`] = `
|
||||
exports[`t-model directive on an input, type=checkbox 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -394,6 +412,7 @@ exports[`t-model directive on an input, type=checkbox 1`] = `
|
||||
exports[`t-model directive on an textarea 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -413,6 +432,7 @@ exports[`t-model directive on an textarea 1`] = `
|
||||
exports[`t-model directive t-model on an input with an undefined value 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -431,6 +451,7 @@ exports[`t-model directive t-model on an input with an undefined value 1`] = `
|
||||
exports[`t-model directive t-model on select with static options 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -452,6 +473,7 @@ exports[`t-model directive t-model on select with static options 1`] = `
|
||||
exports[`t-model directive t-model with dynamic values on select options -- 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -476,6 +498,7 @@ exports[`t-model directive t-model with dynamic values on select options -- 2 1`
|
||||
exports[`t-model directive t-model with dynamic values on select options -- 3 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -499,6 +522,7 @@ exports[`t-model directive t-model with dynamic values on select options -- 3 1`
|
||||
exports[`t-model directive t-model with dynamic values on select options 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -523,6 +547,7 @@ exports[`t-model directive t-model with dynamic values on select options 1`] = `
|
||||
exports[`t-model directive t-model with dynamic values on select options in foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber, prepareList, withKey } = helpers;
|
||||
|
||||
@@ -553,6 +578,7 @@ exports[`t-model directive t-model with dynamic values on select options in fore
|
||||
exports[`t-model directive two inputs in a div alternating with a t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
@@ -584,6 +610,7 @@ exports[`t-model directive two inputs in a div alternating with a t-if 1`] = `
|
||||
exports[`t-model directive with expression having a changing key 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { toNumber } = helpers;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-on t-on expression captured in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
@@ -33,6 +34,7 @@ exports[`t-on t-on expression captured in t-foreach 1`] = `
|
||||
exports[`t-on t-on expression in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -62,6 +64,7 @@ exports[`t-on t-on expression in t-foreach 1`] = `
|
||||
exports[`t-on t-on expression in t-foreach with t-set 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
|
||||
|
||||
@@ -96,6 +99,7 @@ exports[`t-on t-on expression in t-foreach with t-set 1`] = `
|
||||
exports[`t-on t-on method call in t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
@@ -124,6 +128,7 @@ exports[`t-on t-on method call in t-foreach 1`] = `
|
||||
exports[`t-on t-on on component next to t-on on div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -143,6 +148,7 @@ exports[`t-on t-on on component next to t-on on div 1`] = `
|
||||
exports[`t-on t-on on component next to t-on on div 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button><block-text-0/></button>\`);
|
||||
@@ -157,6 +163,7 @@ exports[`t-on t-on on component next to t-on on div 2`] = `
|
||||
exports[`t-on t-on on components 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -172,6 +179,7 @@ exports[`t-on t-on on components 1`] = `
|
||||
exports[`t-on t-on on components 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button><block-text-0/></button>\`);
|
||||
@@ -186,6 +194,7 @@ exports[`t-on t-on on components 2`] = `
|
||||
exports[`t-on t-on on components and t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, createCatcher, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -209,6 +218,7 @@ exports[`t-on t-on on components and t-foreach 1`] = `
|
||||
exports[`t-on t-on on components and t-foreach 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -223,6 +233,7 @@ exports[`t-on t-on on components and t-foreach 2`] = `
|
||||
exports[`t-on t-on on components, variation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -241,6 +252,7 @@ exports[`t-on t-on on components, variation 1`] = `
|
||||
exports[`t-on t-on on components, variation 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button><block-text-0/></button>\`);
|
||||
@@ -255,6 +267,7 @@ exports[`t-on t-on on components, variation 2`] = `
|
||||
exports[`t-on t-on on components, with 'prevent' modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -270,6 +283,7 @@ exports[`t-on t-on on components, with 'prevent' modifier 1`] = `
|
||||
exports[`t-on t-on on components, with 'prevent' modifier 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button><block-text-0/></button>\`);
|
||||
@@ -284,6 +298,7 @@ exports[`t-on t-on on components, with 'prevent' modifier 2`] = `
|
||||
exports[`t-on t-on on components, with a handler update 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -303,6 +318,7 @@ exports[`t-on t-on on components, with a handler update 1`] = `
|
||||
exports[`t-on t-on on components, with a handler update 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -317,6 +333,7 @@ exports[`t-on t-on on components, with a handler update 2`] = `
|
||||
exports[`t-on t-on on destroyed components 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -335,6 +352,7 @@ exports[`t-on t-on on destroyed components 1`] = `
|
||||
exports[`t-on t-on on destroyed components 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click\\"/>\`);
|
||||
@@ -349,6 +367,7 @@ exports[`t-on t-on on destroyed components 2`] = `
|
||||
exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
||||
@@ -368,6 +387,7 @@ exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
|
||||
exports[`t-on t-on on slot, with 'prevent' modifier 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot, createCatcher } = helpers;
|
||||
const catcher1 = createCatcher({\\"click.prevent\\":0});
|
||||
@@ -382,6 +402,7 @@ exports[`t-on t-on on slot, with 'prevent' modifier 2`] = `
|
||||
exports[`t-on t-on on t-set-slots 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, createCatcher, markRaw } = helpers;
|
||||
const catcher1 = createCatcher({\\"click\\":0});
|
||||
@@ -411,6 +432,7 @@ exports[`t-on t-on on t-set-slots 1`] = `
|
||||
exports[`t-on t-on on t-set-slots 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -423,6 +445,7 @@ exports[`t-on t-on on t-set-slots 2`] = `
|
||||
exports[`t-on t-on on t-slots 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
|
||||
@@ -442,6 +465,7 @@ exports[`t-on t-on on t-slots 1`] = `
|
||||
exports[`t-on t-on on t-slots 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot, createCatcher } = helpers;
|
||||
const catcher1 = createCatcher({\\"click\\":0});
|
||||
@@ -456,45 +480,3 @@ exports[`t-on t-on on t-slots 2`] = `
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-on t-on when first component child is an empty component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { createCatcher } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
const catcher1 = createCatcher({\\"click\\":0});
|
||||
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click\\"><block-child-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [ctx['push'], ctx];
|
||||
const hdlr2 = [()=>{}, ctx];
|
||||
const b2 = catcher1(comp1({list: ctx['list']}, key + \`__1\`, node, this, null), [hdlr2]);
|
||||
return block1([hdlr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-on t-on when first component child is an empty component 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
|
||||
let block2 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['props'].list);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`c\`] = v_block1[i1];
|
||||
ctx[\`c_index\`] = i1;
|
||||
const key1 = ctx['c_index'];
|
||||
let txt1 = ctx['c'];
|
||||
c_block1[i1] = withKey(block2([txt1]), key1);
|
||||
}
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`components in t-out simple list 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, isBoundary, withDefault, LazyValue, safeOutput, withKey } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
function value1(ctx, node, key = \\"\\") {
|
||||
return comp1({}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block1, v_block1, l_block1, c_block1] = prepareList([1,2]);;
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`n\`] = v_block1[i1];
|
||||
const key1 = ctx['n'];
|
||||
ctx[\`blabla\`] = new LazyValue(value1, ctx, this, node, key1);
|
||||
c_block1[i1] = withKey(safeOutput(ctx['blabla']), key1);
|
||||
}
|
||||
return list(c_block1);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`components in t-out simple list 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
return text(\`child\`);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-props basic use 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
@@ -18,6 +19,7 @@ exports[`t-props basic use 1`] = `
|
||||
exports[`t-props basic use 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -32,6 +34,7 @@ exports[`t-props basic use 2`] = `
|
||||
exports[`t-props child receives a copy of the t-props object, not the original 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
@@ -44,6 +47,7 @@ exports[`t-props child receives a copy of the t-props object, not the original 1
|
||||
exports[`t-props child receives a copy of the t-props object, not the original 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
@@ -57,6 +61,7 @@ exports[`t-props child receives a copy of the t-props object, not the original 2
|
||||
exports[`t-props t-props and other props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Comp\`, true, false, true, false);
|
||||
|
||||
@@ -72,6 +77,7 @@ exports[`t-props t-props and other props 1`] = `
|
||||
exports[`t-props t-props and other props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
@@ -87,6 +93,7 @@ exports[`t-props t-props and other props 2`] = `
|
||||
exports[`t-props t-props only 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Comp\`, true, false, true, false);
|
||||
|
||||
@@ -102,6 +109,7 @@ exports[`t-props t-props only 1`] = `
|
||||
exports[`t-props t-props only 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
@@ -116,6 +124,7 @@ exports[`t-props t-props only 2`] = `
|
||||
exports[`t-props t-props with props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
||||
|
||||
@@ -131,6 +140,7 @@ exports[`t-props t-props with props 1`] = `
|
||||
exports[`t-props t-props with props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div/>\`);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Childcomp\`, true, true, false, true);
|
||||
@@ -32,6 +33,7 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
|
||||
exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -51,6 +53,7 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
|
||||
exports[`t-set slots with a t-set with a component in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, isBoundary, withDefault, LazyValue, safeOutput, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
||||
@@ -59,7 +62,7 @@ exports[`t-set slots with a t-set with a component in body 1`] = `
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b3 = text(\` in slot \`);
|
||||
const b4 = safeOutput(ctx['v']);
|
||||
return multi([b3, b4]);
|
||||
@@ -79,6 +82,7 @@ exports[`t-set slots with a t-set with a component in body 1`] = `
|
||||
exports[`t-set slots with a t-set with a component in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -93,6 +97,7 @@ exports[`t-set slots with a t-set with a component in body 2`] = `
|
||||
exports[`t-set slots with a t-set with a component in body 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -104,6 +109,7 @@ exports[`t-set slots with a t-set with a component in body 3`] = `
|
||||
exports[`t-set slots with an t-set with a component in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, isBoundary, withDefault, LazyValue, safeOutput, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -114,7 +120,7 @@ exports[`t-set slots with an t-set with a component in body 1`] = `
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b5 = text(\` tea \`);
|
||||
const b6 = safeOutput(ctx['v']);
|
||||
return multi([b5, b6]);
|
||||
@@ -136,6 +142,7 @@ exports[`t-set slots with an t-set with a component in body 1`] = `
|
||||
exports[`t-set slots with an t-set with a component in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -150,6 +157,7 @@ exports[`t-set slots with an t-set with a component in body 2`] = `
|
||||
exports[`t-set slots with an t-set with a component in body 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -161,6 +169,7 @@ exports[`t-set slots with an t-set with a component in body 3`] = `
|
||||
exports[`t-set slots with an unused t-set with a component in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { capture, isBoundary, withDefault, LazyValue, markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -169,7 +178,7 @@ exports[`t-set slots with an unused t-set with a component in body 1`] = `
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
return text(\` in slot \`);
|
||||
}
|
||||
|
||||
@@ -187,6 +196,7 @@ exports[`t-set slots with an unused t-set with a component in body 1`] = `
|
||||
exports[`t-set slots with an unused t-set with a component in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
|
||||
@@ -201,6 +211,7 @@ exports[`t-set slots with an unused t-set with a component in body 2`] = `
|
||||
exports[`t-set t-set can't alter component even if key in component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -220,6 +231,7 @@ exports[`t-set t-set can't alter component even if key in component 1`] = `
|
||||
exports[`t-set t-set can't alter component if key not in component 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -239,10 +251,11 @@ exports[`t-set t-set can't alter component if key not in component 1`] = `
|
||||
exports[`t-set t-set in t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-child-0/><p><block-text-0/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -264,6 +277,7 @@ exports[`t-set t-set in t-if 1`] = `
|
||||
exports[`t-set t-set not altered by child comp 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
const comp1 = app.createComponent(\`Childcomp\`, true, false, false, true);
|
||||
@@ -285,6 +299,7 @@ exports[`t-set t-set not altered by child comp 1`] = `
|
||||
exports[`t-set t-set not altered by child comp 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
@@ -304,10 +319,11 @@ exports[`t-set t-set not altered by child comp 2`] = `
|
||||
exports[`t-set t-set outside modified in t-if 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, setContextValue } = helpers;
|
||||
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p></div>\`);
|
||||
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-child-0/><p><block-text-0/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -330,6 +346,7 @@ exports[`t-set t-set outside modified in t-if 1`] = `
|
||||
exports[`t-set t-set with a component in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -343,7 +360,7 @@ exports[`t-set t-set with a component in body 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b3 = safeOutput(ctx['v']);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
@@ -353,6 +370,7 @@ exports[`t-set t-set with a component in body 1`] = `
|
||||
exports[`t-set t-set with a component in body 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -364,6 +382,7 @@ exports[`t-set t-set with a component in body 2`] = `
|
||||
exports[`t-set t-set with something in body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
|
||||
|
||||
@@ -377,7 +396,7 @@ exports[`t-set t-set with something in body 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node, key);
|
||||
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
|
||||
const b3 = safeOutput(ctx['v']);
|
||||
return block1([], [b3]);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
import { App, Component, mount, status, toRaw, useState, xml } from "../../src";
|
||||
import {
|
||||
elem,
|
||||
makeTestFixture,
|
||||
nextAppError,
|
||||
nextTick,
|
||||
snapshotEverything,
|
||||
useLogLifecycle,
|
||||
} from "../helpers";
|
||||
import { elem, makeTestFixture, nextTick, snapshotEverything, useLogLifecycle } from "../helpers";
|
||||
import { markup } from "../../src/runtime/utils";
|
||||
|
||||
let fixture: HTMLElement;
|
||||
@@ -215,14 +208,14 @@ describe("basics", () => {
|
||||
static template = xml`<div/>`;
|
||||
}
|
||||
let error: Error;
|
||||
const app = new App(Test);
|
||||
const prom = app.mount(fixture);
|
||||
const prom = mount(Test, fixture);
|
||||
await Promise.resolve();
|
||||
fixture.remove();
|
||||
prom.catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
"Cannot mount a component on a detached dom node"
|
||||
);
|
||||
try {
|
||||
await prom;
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe("Cannot mount a component on a detached dom node");
|
||||
expect(console.warn).toBeCalledTimes(1);
|
||||
@@ -1091,25 +1084,4 @@ describe("t-out in components", () => {
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("<div>1</div><div>2</div>");
|
||||
});
|
||||
|
||||
test("t-out and updating falsy values, ", async () => {
|
||||
class Test extends Component {
|
||||
static template = xml`<t t-out="state.a"/>`;
|
||||
state: any = useState({ a: 0 });
|
||||
}
|
||||
|
||||
const comp = await mount(Test, fixture);
|
||||
expect(fixture.innerHTML).toBe("0");
|
||||
comp.state.a = undefined;
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
|
||||
comp.state.a = "hello";
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("hello");
|
||||
|
||||
comp.state.a = false;
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("false");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { App, Component, mount, onWillDestroy } from "../../src";
|
||||
import { Component, mount, onWillDestroy } from "../../src";
|
||||
import {
|
||||
onError,
|
||||
onMounted,
|
||||
@@ -18,9 +18,7 @@ import {
|
||||
nextMicroTick,
|
||||
snapshotEverything,
|
||||
useLogLifecycle,
|
||||
nextAppError,
|
||||
} from "../helpers";
|
||||
import { OwlError } from "../../src/runtime/error_handling";
|
||||
|
||||
let fixture: HTMLElement;
|
||||
|
||||
@@ -60,10 +58,9 @@ describe("basics", () => {
|
||||
parent.state.flag = true;
|
||||
|
||||
parent.render();
|
||||
await expect(nextAppError(parent.__owl__.app)).resolves.toThrow(
|
||||
"An error occured in the owl lifecycle"
|
||||
);
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
expect(mockConsoleError).toBeCalledTimes(1);
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
@@ -73,13 +70,12 @@ describe("basics", () => {
|
||||
static template = xml`<SomeMispelledComponent />`;
|
||||
static components = { SomeComponent };
|
||||
}
|
||||
const app = new App(Parent);
|
||||
let error: Error;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
'Cannot find the definition of component "SomeMispelledComponent"'
|
||||
);
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture);
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe('Cannot find the definition of component "SomeMispelledComponent"');
|
||||
expect(console.error).toBeCalledTimes(0);
|
||||
@@ -93,13 +89,12 @@ describe("basics", () => {
|
||||
static template = xml`<SomeMispelledComponent />`;
|
||||
static components = { SomeComponent };
|
||||
}
|
||||
const app = new App(Parent, { test: true });
|
||||
let error: Error;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
'Cannot find the definition of component "SomeMispelledComponent"'
|
||||
);
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { test: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe('Cannot find the definition of component "SomeMispelledComponent"');
|
||||
expect(console.error).toBeCalledTimes(0);
|
||||
@@ -113,13 +108,13 @@ describe("basics", () => {
|
||||
static template = xml`<SomeComponent />`;
|
||||
static components = { SomeComponent: notAComponentConstructor };
|
||||
}
|
||||
const app = new App(Parent as typeof Component);
|
||||
let error: Error;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
'"SomeComponent" is not a Component. It must inherit from the Component class'
|
||||
);
|
||||
await mountProm;
|
||||
try {
|
||||
// @ts-expect-error
|
||||
await mount(Parent, fixture);
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
'"SomeComponent" is not a Component. It must inherit from the Component class'
|
||||
@@ -160,26 +155,26 @@ describe("basics", () => {
|
||||
describe("errors and promises", () => {
|
||||
test("a rendering error will reject the mount promise", async () => {
|
||||
// we do not catch error in willPatch anymore
|
||||
class Root extends Component {
|
||||
class App extends Component {
|
||||
static template = xml`<div><t t-esc="this.will.crash"/></div>`;
|
||||
}
|
||||
|
||||
const app = new App(Root);
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(App, fixture);
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.cause).toBeDefined();
|
||||
const regexp =
|
||||
/Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g;
|
||||
expect(error!.cause.message).toMatch(regexp);
|
||||
expect(error!.message).toMatch(regexp);
|
||||
expect(mockConsoleError).toBeCalledTimes(0);
|
||||
expect(mockConsoleError).toBeCalledTimes(0);
|
||||
});
|
||||
|
||||
test("an error in mounted call will reject the mount promise", async () => {
|
||||
class Root extends Component {
|
||||
class App extends Component {
|
||||
static template = xml`<div>abc</div>`;
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
@@ -188,21 +183,21 @@ describe("errors and promises", () => {
|
||||
}
|
||||
}
|
||||
|
||||
const app = new App(Root);
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(App, fixture);
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.cause).toBeDefined();
|
||||
expect(error!.cause.message).toBe("boom");
|
||||
expect(error!.message).toBe("boom");
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
expect(mockConsoleError).toBeCalledTimes(0);
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
test("an error in onMounted callback will have the component's setup in its stack trace", async () => {
|
||||
class Root extends Component {
|
||||
class App extends Component {
|
||||
static template = xml`<div>abc</div>`;
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
@@ -211,13 +206,14 @@ describe("errors and promises", () => {
|
||||
}
|
||||
}
|
||||
|
||||
const app = new App(Root, { test: true });
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occurred in onMounted");
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(App, fixture, { test: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.stack).toContain("Root.setup");
|
||||
expect(error!.stack).toContain("App.setup");
|
||||
expect(error!.stack).toContain("error_handling.test.ts");
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
expect(mockConsoleError).toBeCalledTimes(0);
|
||||
@@ -225,7 +221,7 @@ describe("errors and promises", () => {
|
||||
});
|
||||
|
||||
test("errors in onWillRender/onRender aren't wrapped more than once", async () => {
|
||||
class Root extends Component {
|
||||
class App extends Component {
|
||||
static template = xml`<div>abc</div>`;
|
||||
setup() {
|
||||
onWillRender(() => {
|
||||
@@ -237,11 +233,12 @@ describe("errors and promises", () => {
|
||||
}
|
||||
}
|
||||
|
||||
const app = new App(Root, { test: true });
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occurred in onWillRender");
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(App, fixture, { test: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
`The following error occurred in onWillRender: "boom in onWillRender"`
|
||||
@@ -267,29 +264,6 @@ describe("errors and promises", () => {
|
||||
expect(error!.message).toBe("Tokenizer error: could not tokenize `{ 'invalid: 5 }`");
|
||||
});
|
||||
|
||||
test("wrapped errors in async code are correctly caught", async () => {
|
||||
class Root extends Component {
|
||||
static template = xml`<div>abc</div>`;
|
||||
setup() {
|
||||
onWillStart(async () => {
|
||||
await Promise.resolve();
|
||||
throw new Error("boom in onWillStart");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const app = new App(Root, { test: true });
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occurred in onWillStart");
|
||||
await mountProm;
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
`The following error occurred in onWillStart: "boom in onWillStart"`
|
||||
);
|
||||
await new Promise((r) => setTimeout(r, 0)); // wait for the rejection event to bubble
|
||||
});
|
||||
|
||||
test("an error in willPatch call will reject the render promise", async () => {
|
||||
class Root extends Component {
|
||||
static template = xml`<div><t t-esc="val"/></div>`;
|
||||
@@ -341,21 +315,21 @@ describe("errors and promises", () => {
|
||||
class Child extends Component {
|
||||
static template = xml`<div><t t-esc="this.will.crash"/></div>`;
|
||||
}
|
||||
class Parent extends Component {
|
||||
class App extends Component {
|
||||
static template = xml`<div><Child/></div>`;
|
||||
static components = { Child };
|
||||
}
|
||||
|
||||
const app = new App(Parent);
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(App, fixture);
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.cause).toBeDefined();
|
||||
const regexp =
|
||||
/Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g;
|
||||
expect(error!.cause.message).toMatch(regexp);
|
||||
expect(error!.message).toMatch(regexp);
|
||||
expect(mockConsoleError).toBeCalledTimes(0);
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
@@ -365,7 +339,7 @@ describe("errors and promises", () => {
|
||||
static template = xml`<div><t t-if="flag" t-esc="this.will.crash"/></div>`;
|
||||
flag = false;
|
||||
setup() {
|
||||
onError(({ cause }) => (error = cause));
|
||||
onError((e) => (error = e));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,16 +366,16 @@ describe("errors and promises", () => {
|
||||
static components = { Child };
|
||||
}
|
||||
|
||||
const app = new App(Parent);
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(Parent, fixture);
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.cause).toBeDefined();
|
||||
const regexp =
|
||||
/Cannot read properties of undefined \(reading 'y'\)|Cannot read property 'y' of undefined/g;
|
||||
expect(error!.cause.message).toMatch(regexp);
|
||||
expect(error!.message).toMatch(regexp);
|
||||
expect(mockConsoleError).toBeCalledTimes(0);
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
@@ -422,12 +396,13 @@ describe("errors and promises", () => {
|
||||
}
|
||||
}
|
||||
|
||||
const app = new App(Example, { test: true });
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occurred in onMounted");
|
||||
await mountProm;
|
||||
expect(error!.message).toBe(`The following error occurred in onMounted: "Error in mounted"`);
|
||||
try {
|
||||
await mount(Example, fixture, { test: true });
|
||||
} catch (e) {
|
||||
expect((e as Error).message).toBe(
|
||||
`The following error occurred in onMounted: "Error in mounted"`
|
||||
);
|
||||
}
|
||||
// 1 additional error is logged because the destruction of the app causes
|
||||
// the onWillUnmount hook to be called and to fail
|
||||
expect(mockConsoleError).toBeCalledTimes(1);
|
||||
@@ -444,10 +419,9 @@ describe("errors and promises", () => {
|
||||
|
||||
root.state = "boom";
|
||||
root.render();
|
||||
await expect(nextAppError(root.__owl__.app)).resolves.toThrow(
|
||||
"error occured in the owl lifecycle"
|
||||
);
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
expect(mockConsoleError).toBeCalledTimes(1);
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
});
|
||||
@@ -497,150 +471,17 @@ describe("can catch errors", () => {
|
||||
});
|
||||
}
|
||||
}
|
||||
const app = new App(Root, { test: true });
|
||||
let error: OwlError;
|
||||
const crashProm = expect(nextAppError(app)).resolves.toThrow("error occurred in onWillStart");
|
||||
await app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await crashProm;
|
||||
expect(error!.message).toBe(
|
||||
let e: Error;
|
||||
try {
|
||||
await mount(Root, fixture, { test: true });
|
||||
} catch (error) {
|
||||
e = error as Error;
|
||||
}
|
||||
expect(e!.message).toBe(
|
||||
`The following error occurred in onWillStart: "No active component (a hook function should only be called in 'setup')"`
|
||||
);
|
||||
});
|
||||
|
||||
test("Errors have the right cause", async () => {
|
||||
const err = new Error("test error");
|
||||
class Root extends Component {
|
||||
static template = xml`<t t-esc="state.value"/>`;
|
||||
state = useState({ value: 1 });
|
||||
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
}
|
||||
const app = new App(Root, { test: true });
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occurred in onMounted");
|
||||
await mountProm;
|
||||
expect(error!.message).toBe(`The following error occurred in onMounted: "test error"`);
|
||||
expect(error!.cause).toBe(err);
|
||||
});
|
||||
|
||||
test("Errors in owl lifecycle are wrapped in dev mode: async hook", async () => {
|
||||
const err = new Error("test error");
|
||||
class Root extends Component {
|
||||
static template = xml`<t t-esc="state.value"/>`;
|
||||
state = useState({ value: 1 });
|
||||
|
||||
setup() {
|
||||
onWillStart(async () => {
|
||||
await nextMicroTick();
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
}
|
||||
const app = new App(Root, { test: true });
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occurred in onWillStart");
|
||||
await mountProm;
|
||||
expect(error!.message).toBe(`The following error occurred in onWillStart: "test error"`);
|
||||
expect(error!.cause).toBe(err);
|
||||
});
|
||||
|
||||
test("Errors in owl lifecycle are wrapped outside dev mode: sync hook", async () => {
|
||||
const err = new Error("test error");
|
||||
class Root extends Component {
|
||||
static template = xml`<t t-esc="state.value"/>`;
|
||||
state = useState({ value: 1 });
|
||||
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
}
|
||||
const app = new App(Root);
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
expect(error!.message).toBe(
|
||||
`An error occured in the owl lifecycle (see this Error's "cause" property)`
|
||||
);
|
||||
expect(error!.cause).toBe(err);
|
||||
});
|
||||
|
||||
test("Errors in owl lifecycle are wrapped out of dev mode: async hook", async () => {
|
||||
const err = new Error("test error");
|
||||
class Root extends Component {
|
||||
static template = xml`<t t-esc="state.value"/>`;
|
||||
state = useState({ value: 1 });
|
||||
|
||||
setup() {
|
||||
onWillStart(async () => {
|
||||
await nextMicroTick();
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
}
|
||||
const app = new App(Root);
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
expect(error!.message).toBe(
|
||||
`An error occured in the owl lifecycle (see this Error's "cause" property)`
|
||||
);
|
||||
expect(error!.cause).toBe(err);
|
||||
});
|
||||
|
||||
test("Thrown values that are not errors are wrapped in dev mode", async () => {
|
||||
class Root extends Component {
|
||||
static template = xml`<t t-esc="state.value"/>`;
|
||||
state = useState({ value: 1 });
|
||||
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
throw "This is not an error";
|
||||
});
|
||||
}
|
||||
}
|
||||
const app = new App(Root, { test: true });
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("not an Error was thrown in onMounted");
|
||||
await mountProm;
|
||||
expect(error!.message).toBe(
|
||||
`Something that is not an Error was thrown in onMounted (see this Error's "cause" property)`
|
||||
);
|
||||
expect(error!.cause).toBe("This is not an error");
|
||||
});
|
||||
|
||||
test("Thrown values that are not errors are wrapped outside dev mode", async () => {
|
||||
class Root extends Component {
|
||||
static template = xml`<t t-esc="state.value"/>`;
|
||||
state = useState({ value: 1 });
|
||||
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
throw "This is not an error";
|
||||
});
|
||||
}
|
||||
}
|
||||
const app = new App(Root);
|
||||
let error: OwlError;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
expect(error!.message).toBe(
|
||||
`An error occured in the owl lifecycle (see this Error's "cause" property)`
|
||||
);
|
||||
expect(error!.cause).toBe("This is not an error");
|
||||
});
|
||||
|
||||
test("can catch an error in the initial call of a component render function (parent mounted)", async () => {
|
||||
class ErrorComponent extends Component {
|
||||
static template = xml`<div>hey<t t-esc="state.this.will.crash"/></div>`;
|
||||
@@ -1339,8 +1180,8 @@ describe("can catch errors", () => {
|
||||
class Catch extends Component {
|
||||
static template = xml`<t t-slot="default" />`;
|
||||
setup() {
|
||||
onError(({ cause }) => {
|
||||
this.props.onError(cause);
|
||||
onError((error) => {
|
||||
this.props.onError(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,22 +171,4 @@ describe("event handling", () => {
|
||||
// input is removed when component is destroyed => nothing should happen
|
||||
expect([]).toBeLogged();
|
||||
});
|
||||
|
||||
test("handler works when app is mounted in an iframe", async () => {
|
||||
let clickCount = 0;
|
||||
|
||||
class Parent extends Component {
|
||||
static template = xml`<span t-on-click="inc">click me</span>`;
|
||||
inc() {
|
||||
clickCount++;
|
||||
}
|
||||
}
|
||||
const iframe = document.createElement("iframe");
|
||||
fixture.appendChild(iframe);
|
||||
const iframeDoc = iframe.contentDocument!;
|
||||
await mount(Parent, iframeDoc.body);
|
||||
expect(clickCount).toBe(0);
|
||||
iframeDoc.querySelector("span")!.click();
|
||||
expect(clickCount).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -17,16 +17,8 @@ import {
|
||||
useChildSubEnv,
|
||||
useSubEnv,
|
||||
xml,
|
||||
OwlError,
|
||||
} from "../../src/index";
|
||||
import {
|
||||
elem,
|
||||
logStep,
|
||||
makeTestFixture,
|
||||
nextAppError,
|
||||
nextTick,
|
||||
snapshotEverything,
|
||||
} from "../helpers";
|
||||
import { elem, logStep, makeTestFixture, nextTick, snapshotEverything } from "../helpers";
|
||||
|
||||
let fixture: HTMLElement;
|
||||
|
||||
@@ -658,12 +650,11 @@ describe("hooks", () => {
|
||||
}
|
||||
}
|
||||
|
||||
let error: OwlError;
|
||||
const app = new App(MyComponent);
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
expect(error!.cause.message).toBe("Intentional error");
|
||||
try {
|
||||
await mount(MyComponent, fixture);
|
||||
} catch (e: any) {
|
||||
expect(e.message).toBe("Intentional error");
|
||||
}
|
||||
// no console.error because the error has been caught in this test
|
||||
expect(console.error).toHaveBeenCalledTimes(0);
|
||||
console.error = originalconsoleError;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { makeTestFixture, nextAppError, nextTick, snapshotEverything } from "../helpers";
|
||||
import { Component, onError, xml, mount, OwlError } from "../../src";
|
||||
import { App, DEV_MSG } from "../../src/runtime/app";
|
||||
import { makeTestFixture, nextTick, snapshotEverything } from "../helpers";
|
||||
import { Component, onError, xml, mount } from "../../src";
|
||||
import { DEV_MSG } from "../../src/runtime/app";
|
||||
import { validateProps } from "../../src/runtime/template_helpers";
|
||||
import { Schema } from "../../src/runtime/validation";
|
||||
|
||||
@@ -48,14 +48,13 @@ describe("props validation", () => {
|
||||
static components = { SubComp };
|
||||
static template = xml`<div><SubComp /></div>`;
|
||||
}
|
||||
let error: Error | undefined;
|
||||
|
||||
const app = new App(Parent, { test: true });
|
||||
let error: OwlError | undefined;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
"Invalid props for component 'SubComp': 'message' is missing"
|
||||
);
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe("Invalid props for component 'SubComp': 'message' is missing");
|
||||
error = undefined;
|
||||
@@ -78,13 +77,12 @@ describe("props validation", () => {
|
||||
static template = xml`<div><SubComp /></div>`;
|
||||
}
|
||||
|
||||
const app = new App(Parent, { test: true });
|
||||
let error: OwlError | undefined;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
"Invalid props for component 'SubComp': 'message' is missing"
|
||||
);
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe("Invalid props for component 'SubComp': 'message' is missing");
|
||||
});
|
||||
@@ -128,12 +126,14 @@ describe("props validation", () => {
|
||||
};
|
||||
(Parent as any).components = { SubComp };
|
||||
|
||||
let error: Error | undefined;
|
||||
props = {};
|
||||
let app = new App(Parent, { test: true });
|
||||
let error: OwlError | undefined;
|
||||
let mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component '_a'");
|
||||
await mountProm;
|
||||
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
`Invalid props for component '_a': 'p' is undefined (should be a ${test.type.name.toLowerCase()})`
|
||||
@@ -147,10 +147,11 @@ describe("props validation", () => {
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: test.ko };
|
||||
app = new App(Parent, { test: true });
|
||||
mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component '_a'");
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
`Invalid props for component '_a': 'p' is not a ${test.type.name.toLowerCase()}`
|
||||
@@ -180,12 +181,13 @@ describe("props validation", () => {
|
||||
static template = xml`<div>hey</div>`;
|
||||
};
|
||||
(Parent as any).components = { SubComp };
|
||||
let error: Error | undefined;
|
||||
props = {};
|
||||
let app = new App(Parent, { test: true });
|
||||
let error: OwlError | undefined;
|
||||
let mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component '_a'");
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
`Invalid props for component '_a': 'p' is undefined (should be a ${test.type.name.toLowerCase()})`
|
||||
@@ -199,10 +201,11 @@ describe("props validation", () => {
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: test.ko };
|
||||
app = new App(Parent, { test: true });
|
||||
mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component '_a'");
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
`Invalid props for component '_a': 'p' is not a ${test.type.name.toLowerCase()}`
|
||||
@@ -224,25 +227,26 @@ describe("props validation", () => {
|
||||
}
|
||||
let error: Error;
|
||||
let props: { p?: any };
|
||||
props = { p: "string" };
|
||||
try {
|
||||
props = { p: "string" };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: true };
|
||||
try {
|
||||
props = { p: true };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: 1 };
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
props = { p: 1 };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
"Invalid props for component 'SubComp': 'p' is not a string or boolean"
|
||||
@@ -263,25 +267,26 @@ describe("props validation", () => {
|
||||
}
|
||||
let error: Error;
|
||||
let props: { p?: any };
|
||||
props = { p: "key" };
|
||||
try {
|
||||
props = { p: "key" };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = {};
|
||||
try {
|
||||
props = {};
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: 1 };
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
props = { p: 1 };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe("Invalid props for component 'SubComp': 'p' is not a string");
|
||||
});
|
||||
@@ -314,18 +319,20 @@ describe("props validation", () => {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: [1] };
|
||||
let app = new App(Parent, { test: true });
|
||||
let mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
props = { p: [1] };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
error = undefined;
|
||||
app = new App(Parent, { test: true });
|
||||
mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
expect(error!).toBeDefined();
|
||||
try {
|
||||
props = { p: ["string", 1] };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
});
|
||||
|
||||
test("can validate an array with multiple sub element types", async () => {
|
||||
@@ -363,11 +370,12 @@ describe("props validation", () => {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: [true, 1] };
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
props = { p: [true, 1] };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
"Invalid props for component 'SubComp': 'p[1]' is not a string or boolean"
|
||||
@@ -397,30 +405,33 @@ describe("props validation", () => {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: { id: 1, url: "url", extra: true } };
|
||||
let app = new App(Parent, { test: true });
|
||||
let mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
props = { p: { id: 1, url: "url", extra: true } };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
"Invalid props for component 'SubComp': 'p' has not the correct shape (unknown key 'extra')"
|
||||
);
|
||||
props = { p: { id: "1", url: "url" } };
|
||||
app = new App(Parent, { test: true });
|
||||
mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
props = { p: { id: "1", url: "url" } };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
"Invalid props for component 'SubComp': 'p' has not the correct shape ('id' is not a number)"
|
||||
);
|
||||
error = undefined;
|
||||
props = { p: { id: 1 } };
|
||||
app = new App(Parent, { test: true });
|
||||
mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
props = { p: { id: 1 } };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
"Invalid props for component 'SubComp': 'p' has not the correct shape ('url' is missing (should be a string))"
|
||||
@@ -463,11 +474,12 @@ describe("props validation", () => {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeUndefined();
|
||||
props = { p: { id: 1, url: [12, true] } };
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
props = { p: { id: 1, url: [12, true] } };
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
"Invalid props for component 'SubComp': 'p' has not the correct shape ('url' is not a boolean or list of numbers)"
|
||||
@@ -674,10 +686,11 @@ describe("props validation", () => {
|
||||
static components = { SubComp };
|
||||
}
|
||||
let error: Error;
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'SubComp'");
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe("Invalid props for component 'SubComp': 'p' is missing");
|
||||
});
|
||||
@@ -741,10 +754,11 @@ describe("props validation", () => {
|
||||
static template = xml`<div><Child/></div>`;
|
||||
}
|
||||
let error: Error;
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("Invalid props for component 'Child'");
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
"Invalid props for component 'Child': 'mandatory' is missing (should be a number)"
|
||||
@@ -780,32 +794,6 @@ describe("props validation", () => {
|
||||
// we just check that it doesn't throw
|
||||
await expect(mount(Parent, fixture, { dev: true })).resolves.toEqual(expect.anything());
|
||||
});
|
||||
|
||||
test("can validate through slots", async () => {
|
||||
class Child extends Component {
|
||||
static props = ["message"];
|
||||
static template = xml`<div>hey</div>`;
|
||||
}
|
||||
|
||||
class Wrapper extends Component {
|
||||
static template = xml`<t t-slot="default"/>`;
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static components = { Child, Wrapper };
|
||||
static template = xml`<Wrapper><Child /></Wrapper>`;
|
||||
}
|
||||
|
||||
const app = new App(Parent, { test: true });
|
||||
let error: OwlError | undefined;
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
"Invalid props for component 'Child': 'message' is missing"
|
||||
);
|
||||
await mountProm;
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe("Invalid props for component 'Child': 'message' is missing");
|
||||
});
|
||||
});
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -871,12 +859,11 @@ describe("default props", () => {
|
||||
static template = xml`<Child/>`;
|
||||
}
|
||||
let error: Error;
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
"default value cannot be defined for a mandatory prop"
|
||||
);
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(
|
||||
"A default value cannot be defined for a mandatory prop (name: 'mandatory', component: Child)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { App, Component, mount, onMounted, useRef, useState } from "../../src/index";
|
||||
import { logStep, makeTestFixture, nextAppError, nextTick, snapshotEverything } from "../helpers";
|
||||
import { Component, mount, onMounted, useRef, useState } from "../../src/index";
|
||||
import { logStep, makeTestFixture, nextTick, snapshotEverything } from "../helpers";
|
||||
import { xml } from "../../src/index";
|
||||
|
||||
snapshotEverything();
|
||||
@@ -94,14 +94,9 @@ describe("refs", () => {
|
||||
ref = useRef("coucou");
|
||||
}
|
||||
|
||||
const app = new App(Test, { test: true });
|
||||
const mountProm = expect(app.mount(fixture)).rejects.toThrowError(
|
||||
"Cannot have 2 elements with same ref name at the same time"
|
||||
);
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
"Cannot have 2 elements with same ref name at the same time"
|
||||
);
|
||||
await mountProm;
|
||||
await expect(async () => {
|
||||
await mount(Test, fixture);
|
||||
}).rejects.toThrowError("Cannot have 2 elements with same ref name at the same time");
|
||||
expect(console.warn).toBeCalledTimes(1);
|
||||
console.warn = consoleWarn;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { App, Component, mount, onMounted, useState, xml } from "../../src/index";
|
||||
import { children, makeTestFixture, nextAppError, nextTick, snapshotEverything } from "../helpers";
|
||||
import { children, makeTestFixture, nextTick, snapshotEverything } from "../helpers";
|
||||
|
||||
snapshotEverything();
|
||||
let originalconsoleWarn = console.warn;
|
||||
@@ -45,23 +45,6 @@ describe("slots", () => {
|
||||
expect(fixture.innerHTML).toBe("some text");
|
||||
});
|
||||
|
||||
test("t-set-slot=default has priority over rest of the content", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`<t t-slot="default"/>`;
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static template = xml`<Child>
|
||||
some text
|
||||
<t t-set-slot="default">some other text</t>
|
||||
</Child>`;
|
||||
static components = { Child };
|
||||
}
|
||||
await mount(Parent, fixture);
|
||||
|
||||
expect(fixture.innerHTML).toBe("some other text");
|
||||
});
|
||||
|
||||
test("simple slot with slot scope", async () => {
|
||||
let child: any;
|
||||
class Child extends Component {
|
||||
@@ -221,12 +204,13 @@ describe("slots", () => {
|
||||
static components = { Child };
|
||||
}
|
||||
|
||||
let error: Error;
|
||||
const app = new App(Parent);
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
expect(error!).not.toBeNull();
|
||||
let error = null;
|
||||
try {
|
||||
await mount(Parent, fixture);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
expect(error).not.toBeNull();
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
@@ -1835,102 +1819,4 @@ describe("slots", () => {
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("<button>inc</button>[B][C][A][sub1] [sub2334]");
|
||||
});
|
||||
|
||||
test("slot in multiple locations", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`<div>child</div>`;
|
||||
}
|
||||
|
||||
class Slotter extends Component {
|
||||
static components = { Child };
|
||||
static template = xml`
|
||||
<t t-if="props.location === 1">
|
||||
<p><t t-slot="default"/></p>
|
||||
</t>
|
||||
<t t-if="props.location === 2">
|
||||
<t t-slot="default"/>
|
||||
</t>
|
||||
`;
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static components = { Child, Slotter };
|
||||
static template = xml`
|
||||
<Slotter location="state.location">
|
||||
hello <Child/>
|
||||
</Slotter>`;
|
||||
state = useState({ location: 1 });
|
||||
}
|
||||
|
||||
const parent = await mount(Parent, fixture);
|
||||
expect(fixture.innerHTML).toBe("<p> hello <div>child</div></p>");
|
||||
parent.state.location = 2;
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe(" hello <div>child</div>");
|
||||
});
|
||||
|
||||
test("dynamic slot in multiple locations", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`<div>child</div>`;
|
||||
}
|
||||
|
||||
class Slotter extends Component {
|
||||
static components = { Child };
|
||||
static template = xml`
|
||||
<t t-if="props.location === 1">
|
||||
<p><t t-slot="{{'coffee'}}"/></p>
|
||||
</t>
|
||||
<t t-if="props.location === 2">
|
||||
<t t-slot="{{'coffee'}}"/>
|
||||
</t>
|
||||
`;
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static components = { Child, Slotter };
|
||||
static template = xml`
|
||||
<Slotter location="state.location">
|
||||
<t t-set-slot="coffee">hello <Child/></t>
|
||||
</Slotter>`;
|
||||
state = useState({ location: 1 });
|
||||
}
|
||||
|
||||
const parent = await mount(Parent, fixture);
|
||||
expect(fixture.innerHTML).toBe("<p>hello <div>child</div></p>");
|
||||
parent.state.location = 2;
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("hello <div>child</div>");
|
||||
});
|
||||
|
||||
test("slot in t-foreach locations", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`<div>child</div>`;
|
||||
}
|
||||
|
||||
class Slotter extends Component {
|
||||
static components = { Child };
|
||||
static template = xml`
|
||||
<t t-foreach="props.list" t-as="elem" t-key="elem_index">
|
||||
<p><t t-esc="elem"/><t t-slot="default"/></p>
|
||||
</t>
|
||||
`;
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static components = { Child, Slotter };
|
||||
static template = xml`
|
||||
<Slotter list="state.list">
|
||||
hello <Child/>
|
||||
</Slotter>`;
|
||||
state = useState({ list: [1] });
|
||||
}
|
||||
|
||||
const parent = await mount(Parent, fixture);
|
||||
expect(fixture.innerHTML).toBe("<p>1 hello <div>child</div></p>");
|
||||
parent.state.list.push(2);
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe(
|
||||
"<p>1 hello <div>child</div></p><p>2 hello <div>child</div></p>"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { OwlError } from "../../src/runtime/error_handling";
|
||||
import { App, Component, mount, onMounted, useState, xml } from "../../src";
|
||||
import { makeTestFixture, nextAppError, nextTick, snapshotEverything } from "../helpers";
|
||||
import { Component, mount, onMounted, useState, xml } from "../../src";
|
||||
import { makeTestFixture, nextTick, snapshotEverything } from "../helpers";
|
||||
|
||||
snapshotEverything();
|
||||
let fixture: HTMLElement;
|
||||
@@ -343,20 +342,20 @@ describe("style and class handling", () => {
|
||||
class Child extends Component {
|
||||
static template = xml`<div t-att-class="props.class" t-esc="this.will.crash"/>`;
|
||||
}
|
||||
class Parent extends Component {
|
||||
class ParentWidget extends Component {
|
||||
static template = xml`<Child class="'a'"/>`;
|
||||
static components = { Child };
|
||||
}
|
||||
let error: OwlError;
|
||||
const app = new App(Parent);
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(ParentWidget, fixture);
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.cause).toBeDefined();
|
||||
const regexp =
|
||||
/Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g;
|
||||
expect(error!.cause.message).toMatch(regexp);
|
||||
expect(error!.message).toMatch(regexp);
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
@@ -287,32 +287,4 @@ describe("t-call", () => {
|
||||
});
|
||||
expect(fixture.innerHTML).toBe("childaaronchildlucas");
|
||||
});
|
||||
|
||||
test("t-call with t-call-context and subcomponent, in dev mode", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`child<t t-esc="props.name"/>`;
|
||||
static props = ["name"];
|
||||
}
|
||||
|
||||
class Root extends Component {
|
||||
static template = xml`
|
||||
<t t-call="someTemplate" t-call-context="subctx"/>`;
|
||||
|
||||
static components = { Child };
|
||||
|
||||
subctx = { aab: "aaron", lpe: "lucas" };
|
||||
}
|
||||
|
||||
await mount(Root, fixture, {
|
||||
dev: true,
|
||||
templates: `
|
||||
<templates>
|
||||
<t t-name="someTemplate">
|
||||
<Child name="aab"/>
|
||||
<Child name="lpe"/>
|
||||
</t>
|
||||
</templates>`,
|
||||
});
|
||||
expect(fixture.innerHTML).toBe("childaaronchildlucas");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import { App, Component, mount, onMounted, useState, xml } from "../../src/index";
|
||||
import {
|
||||
makeTestFixture,
|
||||
nextAppError,
|
||||
nextTick,
|
||||
snapshotEverything,
|
||||
useLogLifecycle,
|
||||
} from "../helpers";
|
||||
import { Component, mount, onMounted, useState, xml } from "../../src/index";
|
||||
import { makeTestFixture, nextTick, snapshotEverything, useLogLifecycle } from "../helpers";
|
||||
|
||||
snapshotEverything();
|
||||
|
||||
@@ -321,73 +315,10 @@ describe("list of components", () => {
|
||||
`;
|
||||
static components = { Child };
|
||||
}
|
||||
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = expect(app.mount(fixture)).rejects.toThrow(
|
||||
"Got duplicate key in t-foreach: child"
|
||||
);
|
||||
await expect(nextAppError(app)).resolves.toThrow("Got duplicate key in t-foreach: child");
|
||||
await mountProm;
|
||||
await expect(async () => {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
}).rejects.toThrowError("Got duplicate key in t-foreach: child");
|
||||
console.info = consoleInfo;
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
test("crash when using object as keys that serialize to the same string", async () => {
|
||||
const consoleInfo = console.info;
|
||||
console.info = jest.fn();
|
||||
class Child extends Component {
|
||||
static template = xml``;
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static template = xml`
|
||||
<t t-foreach="[{}, {}]" t-as="item" t-key="item">
|
||||
<Child/>
|
||||
</t>
|
||||
`;
|
||||
static components = { Child };
|
||||
}
|
||||
|
||||
const app = new App(Parent, { test: true });
|
||||
const mountProm = expect(app.mount(fixture)).rejects.toThrow(
|
||||
"Got duplicate key in t-foreach: [object Object]"
|
||||
);
|
||||
await expect(nextAppError(app)).resolves.toThrow(
|
||||
"Got duplicate key in t-foreach: [object Object]"
|
||||
);
|
||||
await mountProm;
|
||||
console.info = consoleInfo;
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
test("order is correct when slots are not of same type", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`
|
||||
<t t-slot="{{ slotName }}" t-foreach="slotNames" t-as="slotName" t-key="slotName"/>
|
||||
`;
|
||||
get slotNames() {
|
||||
return Object.entries(this.props.slots)
|
||||
.filter((entry: any) => entry[1].active)
|
||||
.map((entry) => entry[0]);
|
||||
}
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static template = xml`
|
||||
<Child>
|
||||
<t t-set-slot="a" active="!state.active"><div t-if="!state.active">A</div></t>
|
||||
<t t-set-slot="b" active="true">B</t>
|
||||
<t t-set-slot="c" active="state.active">C</t>
|
||||
</Child>
|
||||
`;
|
||||
static components = { Child };
|
||||
state = useState({ active: false });
|
||||
}
|
||||
|
||||
const parent = await mount(Parent, fixture);
|
||||
expect(fixture.textContent).toBe("AB");
|
||||
parent.state.active = true;
|
||||
await nextTick();
|
||||
expect(fixture.textContent).toBe("BC");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,30 +41,6 @@ describe("t-on", () => {
|
||||
expect(steps).toEqual(["click"]);
|
||||
});
|
||||
|
||||
test("t-on when first component child is an empty component", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`
|
||||
<span t-foreach="props.list" t-as="c" t-key="c_index" t-esc="c"/>
|
||||
`;
|
||||
}
|
||||
class Parent extends Component {
|
||||
static template = xml`
|
||||
<div t-on-click="push"><Child list="list" t-on-click="() => {}"/></div>
|
||||
`;
|
||||
static components = { Child };
|
||||
list = useState([] as string[]);
|
||||
push() {
|
||||
this.list.push("foo");
|
||||
}
|
||||
}
|
||||
const parent = await mount(Parent, fixture);
|
||||
const el = elem(parent);
|
||||
expect(el.innerHTML).toBe("");
|
||||
el.click();
|
||||
await nextTick();
|
||||
expect(el.innerHTML).toBe("<span>foo</span>");
|
||||
});
|
||||
|
||||
test("t-on expression in t-foreach", async () => {
|
||||
class Comp extends Component {
|
||||
static template = xml`
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
import { Component, mount, xml } from "../../src/index";
|
||||
import { makeTestFixture, snapshotEverything } from "../helpers";
|
||||
|
||||
snapshotEverything();
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// t-out
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
describe("components in t-out", () => {
|
||||
let fixture: HTMLElement;
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = makeTestFixture();
|
||||
});
|
||||
|
||||
test("simple list", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`child`;
|
||||
}
|
||||
|
||||
class Parent extends Component {
|
||||
static template = xml`
|
||||
<t t-foreach="[1,2]" t-as="n" t-key="n">
|
||||
<t t-set="blabla">
|
||||
<Child />
|
||||
</t>
|
||||
<t t-out="blabla"/>
|
||||
</t>`;
|
||||
static components = { Child };
|
||||
}
|
||||
|
||||
await mount(Parent, fixture);
|
||||
expect(fixture.innerHTML).toBe("childchild");
|
||||
});
|
||||
});
|
||||
+1
-16
@@ -19,7 +19,6 @@ import { helpers } from "../src/runtime/template_helpers";
|
||||
import { TemplateSet, globalTemplates } from "../src/runtime/template_set";
|
||||
import { BDom } from "../src/runtime/blockdom";
|
||||
import { compile } from "../src/compiler";
|
||||
import { OwlError } from "../src/runtime/error_handling";
|
||||
|
||||
const mount = blockDom.mount;
|
||||
|
||||
@@ -222,7 +221,7 @@ export async function editInput(input: HTMLInputElement | HTMLTextAreaElement, v
|
||||
afterEach(() => {
|
||||
if (steps.length) {
|
||||
steps.splice(0);
|
||||
throw new OwlError("Remaining steps! Should be checked by a .toBeLogged() assertion!");
|
||||
throw new Error("Remaining steps! Should be checked by a .toBeLogged() assertion!");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -261,20 +260,6 @@ expect.extend({
|
||||
},
|
||||
});
|
||||
|
||||
export function nextAppError(app: any) {
|
||||
const { handleError } = app;
|
||||
return new Promise((resolve) => {
|
||||
app.handleError = (...args: Parameters<typeof handleError>) => {
|
||||
try {
|
||||
handleError.call(app, ...args);
|
||||
} catch (e: any) {
|
||||
app.handleError = handleError;
|
||||
resolve(e);
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace jest {
|
||||
interface Matchers<R> {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
exports[`Portal Add and remove portals 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, withKey } = helpers;
|
||||
const Portal = app.Portal;
|
||||
@@ -31,6 +32,7 @@ exports[`Portal Add and remove portals 1`] = `
|
||||
exports[`Portal Add and remove portals on div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, withKey } = helpers;
|
||||
const Portal = app.Portal;
|
||||
@@ -60,6 +62,7 @@ exports[`Portal Add and remove portals on div 1`] = `
|
||||
exports[`Portal Add and remove portals with t-foreach 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, withKey } = helpers;
|
||||
const Portal = app.Portal;
|
||||
@@ -92,6 +95,7 @@ exports[`Portal Add and remove portals with t-foreach 1`] = `
|
||||
exports[`Portal Add and remove portals with t-foreach and destroy 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, withKey } = helpers;
|
||||
const Portal = app.Portal;
|
||||
@@ -124,6 +128,7 @@ exports[`Portal Add and remove portals with t-foreach and destroy 1`] = `
|
||||
exports[`Portal Add and remove portals with t-foreach inside div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, withKey } = helpers;
|
||||
const Portal = app.Portal;
|
||||
@@ -155,47 +160,10 @@ exports[`Portal Add and remove portals with t-foreach inside div 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`Portal Child and Portal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
let block3 = createBlock(\`<div class=\\"portal\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
const b3 = block3();
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`Portal Child and Portal 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
|
||||
let block2 = createBlock(\`<span>child</span>\`);
|
||||
let block3 = createBlock(\`<span>portal</span>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
return block3();
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = block2();
|
||||
const b4 = comp1({target: '.portal',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
|
||||
return multi([b2, b4]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`Portal Portal composed with t-slot 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { markRaw } = helpers;
|
||||
const comp1 = app.createComponent(\`Child2\`, true, false, false, false);
|
||||
@@ -217,6 +185,7 @@ exports[`Portal Portal composed with t-slot 1`] = `
|
||||
exports[`Portal Portal composed with t-slot 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { callSlot } = helpers;
|
||||
const Portal = app.Portal;
|
||||
@@ -235,6 +204,7 @@ exports[`Portal Portal composed with t-slot 2`] = `
|
||||
exports[`Portal Portal composed with t-slot 3`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"custom\\"><span id=\\"childSpan\\">child2</span></div>\`);
|
||||
@@ -249,6 +219,7 @@ exports[`Portal Portal composed with t-slot 3`] = `
|
||||
exports[`Portal basic use of portal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -270,6 +241,7 @@ exports[`Portal basic use of portal 1`] = `
|
||||
exports[`Portal basic use of portal in dev mode 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -291,6 +263,7 @@ exports[`Portal basic use of portal in dev mode 1`] = `
|
||||
exports[`Portal basic use of portal on div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -312,6 +285,7 @@ exports[`Portal basic use of portal on div 1`] = `
|
||||
exports[`Portal basic use of portal, variation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -333,6 +307,7 @@ exports[`Portal basic use of portal, variation 1`] = `
|
||||
exports[`Portal conditional use of Portal (with sub Component) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -358,6 +333,7 @@ exports[`Portal conditional use of Portal (with sub Component) 1`] = `
|
||||
exports[`Portal conditional use of Portal (with sub Component) 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
@@ -372,6 +348,7 @@ exports[`Portal conditional use of Portal (with sub Component) 2`] = `
|
||||
exports[`Portal conditional use of Portal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -397,6 +374,7 @@ exports[`Portal conditional use of Portal 1`] = `
|
||||
exports[`Portal conditional use of Portal with child and div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -413,6 +391,7 @@ exports[`Portal conditional use of Portal with child and div 1`] = `
|
||||
exports[`Portal conditional use of Portal with child and div 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, withKey } = helpers;
|
||||
const Portal = app.Portal;
|
||||
@@ -443,6 +422,7 @@ exports[`Portal conditional use of Portal with child and div 2`] = `
|
||||
exports[`Portal conditional use of Portal with child and div, variation 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
@@ -462,6 +442,7 @@ exports[`Portal conditional use of Portal with child and div, variation 1`] = `
|
||||
exports[`Portal conditional use of Portal with child and div, variation 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
let { prepareList, capture, withKey } = helpers;
|
||||
const Portal = app.Portal;
|
||||
@@ -493,6 +474,7 @@ exports[`Portal conditional use of Portal with child and div, variation 2`] = `
|
||||
exports[`Portal conditional use of Portal with div 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -518,6 +500,7 @@ exports[`Portal conditional use of Portal with div 1`] = `
|
||||
exports[`Portal lifecycle hooks of portal sub component are properly called 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -542,6 +525,7 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 1`]
|
||||
exports[`Portal lifecycle hooks of portal sub component are properly called 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -553,47 +537,10 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 2`]
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`Portal portal and Child 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
|
||||
let block2 = createBlock(\`<div class=\\"portal\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = block2();
|
||||
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`Portal portal and Child 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
|
||||
let block2 = createBlock(\`<span>child</span>\`);
|
||||
let block3 = createBlock(\`<span>portal</span>\`);
|
||||
|
||||
function slot1(ctx, node, key = \\"\\") {
|
||||
return block3();
|
||||
}
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const b2 = block2();
|
||||
const b4 = comp1({target: '.portal',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
|
||||
return multi([b2, b4]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`Portal portal could have dynamically no content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -620,6 +567,7 @@ exports[`Portal portal could have dynamically no content 1`] = `
|
||||
exports[`Portal portal destroys on crash 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -641,6 +589,7 @@ exports[`Portal portal destroys on crash 1`] = `
|
||||
exports[`Portal portal destroys on crash 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -655,6 +604,7 @@ exports[`Portal portal destroys on crash 2`] = `
|
||||
exports[`Portal portal with child and props 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -676,6 +626,7 @@ exports[`Portal portal with child and props 1`] = `
|
||||
exports[`Portal portal with child and props 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
@@ -690,6 +641,7 @@ exports[`Portal portal with child and props 2`] = `
|
||||
exports[`Portal portal with dynamic body 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -719,6 +671,7 @@ exports[`Portal portal with dynamic body 1`] = `
|
||||
exports[`Portal portal with many children 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -743,6 +696,7 @@ exports[`Portal portal with many children 1`] = `
|
||||
exports[`Portal portal with no content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -767,6 +721,7 @@ exports[`Portal portal with no content 1`] = `
|
||||
exports[`Portal portal with only text as content 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -787,6 +742,7 @@ exports[`Portal portal with only text as content 1`] = `
|
||||
exports[`Portal portal with target not in dom 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -808,6 +764,7 @@ exports[`Portal portal with target not in dom 1`] = `
|
||||
exports[`Portal portal's parent's env is not polluted 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
||||
@@ -829,6 +786,7 @@ exports[`Portal portal's parent's env is not polluted 1`] = `
|
||||
exports[`Portal portal's parent's env is not polluted 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<button>child</button>\`);
|
||||
@@ -842,6 +800,7 @@ exports[`Portal portal's parent's env is not polluted 2`] = `
|
||||
exports[`Portal simple catchError with portal 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
||||
|
||||
@@ -862,6 +821,7 @@ exports[`Portal simple catchError with portal 1`] = `
|
||||
exports[`Portal simple catchError with portal 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -884,6 +844,7 @@ exports[`Portal simple catchError with portal 2`] = `
|
||||
exports[`Portal with target in template (after portal) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -905,6 +866,7 @@ exports[`Portal with target in template (after portal) 1`] = `
|
||||
exports[`Portal with target in template (before portal) 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -926,6 +888,7 @@ exports[`Portal with target in template (before portal) 1`] = `
|
||||
exports[`Portal: Props validation target must be a valid selector 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -947,6 +910,7 @@ exports[`Portal: Props validation target must be a valid selector 1`] = `
|
||||
exports[`Portal: Props validation target must be a valid selector 2 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(null, false, true, false, false);
|
||||
@@ -968,6 +932,7 @@ exports[`Portal: Props validation target must be a valid selector 2 1`] = `
|
||||
exports[`Portal: UI/UX focus is kept across re-renders 1`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
const Portal = app.Portal;
|
||||
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
||||
@@ -989,6 +954,7 @@ exports[`Portal: UI/UX focus is kept across re-renders 1`] = `
|
||||
exports[`Portal: UI/UX focus is kept across re-renders 2`] = `
|
||||
"function anonymous(app, bdom, helpers
|
||||
) {
|
||||
\\"use strict\\";
|
||||
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<input id=\\"target-me\\" block-attribute-0=\\"placeholder\\"/>\`);
|
||||
|
||||
+20
-61
@@ -1,4 +1,3 @@
|
||||
import { OwlError } from "../../src/runtime/error_handling";
|
||||
import {
|
||||
App,
|
||||
Component,
|
||||
@@ -12,7 +11,7 @@ import {
|
||||
} from "../../src";
|
||||
import { xml } from "../../src/";
|
||||
import { DEV_MSG } from "../../src/runtime/app";
|
||||
import { elem, makeTestFixture, nextAppError, nextTick, snapshotEverything } from "../helpers";
|
||||
import { elem, makeTestFixture, nextTick, snapshotEverything } from "../helpers";
|
||||
|
||||
let fixture: HTMLElement;
|
||||
let originalconsoleWarn = console.warn;
|
||||
@@ -269,14 +268,15 @@ describe("Portal", () => {
|
||||
}
|
||||
|
||||
let error: Error;
|
||||
const app = new App(Parent);
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("invalid portal target");
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture);
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe("invalid portal target");
|
||||
expect(fixture.innerHTML).toBe(``);
|
||||
expect(fixture.innerHTML).toBe(`<div></div>`);
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
@@ -499,7 +499,7 @@ describe("Portal", () => {
|
||||
</div>`;
|
||||
state = { error: false };
|
||||
setup() {
|
||||
onError(({ cause }) => (error = cause));
|
||||
onError((e) => (error = e));
|
||||
}
|
||||
}
|
||||
addOutsideDiv(fixture);
|
||||
@@ -874,48 +874,6 @@ describe("Portal", () => {
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe('<div id="outside"></div><div></div>');
|
||||
});
|
||||
|
||||
test("Child and Portal", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`
|
||||
<span>child</span>
|
||||
<t t-portal="'.portal'"><span>portal</span></t>`;
|
||||
}
|
||||
class Parent extends Component {
|
||||
static template = xml`
|
||||
<t>
|
||||
<Child/>
|
||||
<div class="portal"></div>
|
||||
</t>`;
|
||||
|
||||
static components = { Child };
|
||||
}
|
||||
await mount(Parent, fixture);
|
||||
expect(fixture.innerHTML).toBe(
|
||||
'<span>child</span><div class="portal"><span>portal</span></div>'
|
||||
);
|
||||
});
|
||||
|
||||
test("portal and Child", async () => {
|
||||
class Child extends Component {
|
||||
static template = xml`
|
||||
<span>child</span>
|
||||
<t t-portal="'.portal'"><span>portal</span></t>`;
|
||||
}
|
||||
class Parent extends Component {
|
||||
static template = xml`
|
||||
<t>
|
||||
<div class="portal"></div>
|
||||
<Child/>
|
||||
</t>`;
|
||||
|
||||
static components = { Child };
|
||||
}
|
||||
await mount(Parent, fixture);
|
||||
expect(fixture.innerHTML).toBe(
|
||||
'<div class="portal"><span>portal</span></div><span>child</span>'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Portal: UI/UX", () => {
|
||||
@@ -1000,14 +958,14 @@ describe("Portal: Props validation", () => {
|
||||
</t>
|
||||
</div>`;
|
||||
}
|
||||
let error: OwlError;
|
||||
const app = new App(Parent);
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("error occured in the owl lifecycle");
|
||||
await mountProm;
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.cause).toBeDefined();
|
||||
expect(error!.cause.message).toBe(`' ' is not a valid selector`);
|
||||
expect(error!.message).toBe(`' ' is not a valid selector`);
|
||||
});
|
||||
|
||||
test("target must be a valid selector 2", async () => {
|
||||
@@ -1020,10 +978,11 @@ describe("Portal: Props validation", () => {
|
||||
</div>`;
|
||||
}
|
||||
let error: Error;
|
||||
const app = new App(Parent);
|
||||
const mountProm = app.mount(fixture).catch((e: Error) => (error = e));
|
||||
await expect(nextAppError(app)).resolves.toThrow("invalid portal target");
|
||||
await mountProm;
|
||||
try {
|
||||
await mount(Parent, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe(`invalid portal target`);
|
||||
});
|
||||
|
||||
+3
-1
@@ -72,8 +72,10 @@ async function startRelease() {
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
log(`Step 3/${STEPS}: updating package.json...`);
|
||||
log(`Step 3/${STEPS}: updating package.json, readme.md and roadmap.md...`);
|
||||
await replaceInFile("./package.json", current, next);
|
||||
await replaceInFile("./README.md", current, next);
|
||||
await replaceInFile("./roadmap.md", current, next);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
log(`Step 4/${STEPS}: creating git commit...`);
|
||||
|
||||
Reference in New Issue
Block a user