marko 6.0.8 → 6.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/debug/dom.js +59 -47
- package/dist/debug/dom.mjs +59 -47
- package/dist/debug/html.js +98 -70
- package/dist/debug/html.mjs +98 -70
- package/dist/dom/resume.d.ts +2 -0
- package/dist/dom.js +38 -32
- package/dist/dom.mjs +38 -32
- package/dist/html/writer.d.ts +8 -8
- package/dist/html.js +64 -28
- package/dist/html.mjs +64 -28
- package/dist/translator/index.js +1294 -1170
- package/dist/translator/util/is-only-child-in-parent.d.ts +2 -2
- package/dist/translator/util/optional.d.ts +1 -0
- package/dist/translator/util/references.d.ts +16 -5
- package/dist/translator/util/serialize-reasons.d.ts +10 -12
- package/dist/translator/util/with-comment.d.ts +2 -0
- package/dist/translator/visitors/program/html.d.ts +4 -3
- package/dist/translator/visitors/program/index.d.ts +9 -5
- package/dist/translator/visitors/tag/native-tag.d.ts +2 -2
- package/package.json +1 -1
package/dist/debug/dom.js
CHANGED
@@ -246,6 +246,10 @@ var DEFAULT_RENDER_ID = "_";
|
|
246
246
|
|
247
247
|
// src/dom/resume.ts
|
248
248
|
var registeredValues = {};
|
249
|
+
var branchesEnabled;
|
250
|
+
function enableBranches() {
|
251
|
+
branchesEnabled = 1;
|
252
|
+
}
|
249
253
|
function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
250
254
|
if (true) {
|
251
255
|
if (!runtimeId.match(/^[_$a-z][_$a-z0-9]*$/i)) {
|
@@ -312,41 +316,43 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
312
316
|
if (token === "*" /* Node */) {
|
313
317
|
const node = scope[data2] = visit.previousSibling;
|
314
318
|
scope["Getter:" /* Getter */ + data2] = () => node;
|
315
|
-
} else if (
|
316
|
-
if (
|
317
|
-
|
319
|
+
} else if (branchesEnabled) {
|
320
|
+
if (token === "[" /* BranchStart */) {
|
321
|
+
if (currentBranchId && dataIndex) {
|
322
|
+
branchEnd(currentBranchId, visit);
|
323
|
+
currentBranchId = branchStack.pop();
|
324
|
+
}
|
325
|
+
if (currentBranchId) {
|
326
|
+
branchStack.push(currentBranchId);
|
327
|
+
parentBranchIds.set(scopeId, currentBranchId);
|
328
|
+
}
|
329
|
+
currentBranchId = scopeId;
|
330
|
+
scope.___startNode = visit;
|
331
|
+
} else if (token === "]" /* BranchEnd */) {
|
332
|
+
scope[data2] = visit;
|
333
|
+
const curParent = visit.parentNode;
|
334
|
+
const startNode = branchEnd(
|
335
|
+
currentBranchId,
|
336
|
+
visit
|
337
|
+
).___startNode;
|
338
|
+
if (curParent !== startNode.parentNode) {
|
339
|
+
curParent.prepend(startNode);
|
340
|
+
}
|
318
341
|
currentBranchId = branchStack.pop();
|
319
|
-
}
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
if (curParent !== startNode.parentNode) {
|
334
|
-
curParent.prepend(startNode);
|
335
|
-
}
|
336
|
-
currentBranchId = branchStack.pop();
|
337
|
-
} else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
|
338
|
-
let next = data2.indexOf(" ");
|
339
|
-
let curNode = visit;
|
340
|
-
scope[~next ? data2.slice(0, next) : data2] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit;
|
341
|
-
while (~next) {
|
342
|
-
const start = next + 1;
|
343
|
-
next = data2.indexOf(" ", start);
|
344
|
-
const childScopeId = +data2.slice(
|
345
|
-
start,
|
346
|
-
~next ? next : data2.length
|
347
|
-
);
|
348
|
-
curNode = branchEnd(childScopeId, curNode).___endNode;
|
349
|
-
parentBranchIds.set(childScopeId, scopeId);
|
342
|
+
} else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
|
343
|
+
let next = data2.indexOf(" ");
|
344
|
+
let curNode = visit;
|
345
|
+
scope[~next ? data2.slice(0, next) : data2] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit;
|
346
|
+
while (~next) {
|
347
|
+
const start = next + 1;
|
348
|
+
next = data2.indexOf(" ", start);
|
349
|
+
const childScopeId = +data2.slice(
|
350
|
+
start,
|
351
|
+
~next ? next : data2.length
|
352
|
+
);
|
353
|
+
curNode = branchEnd(childScopeId, curNode).___endNode;
|
354
|
+
parentBranchIds.set(childScopeId, scopeId);
|
355
|
+
}
|
350
356
|
}
|
351
357
|
}
|
352
358
|
}
|
@@ -378,19 +384,21 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
378
384
|
prevScope
|
379
385
|
);
|
380
386
|
}
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
387
|
+
if (branchesEnabled) {
|
388
|
+
const parentBranchId = scope["#ClosestBranchId" /* ClosestBranchId */] || parentBranchIds.get(scopeId);
|
389
|
+
if (parentBranchId) {
|
390
|
+
scope.___closestBranch = scopeLookup[parentBranchId];
|
391
|
+
}
|
392
|
+
if (branchIds.has(scopeId)) {
|
393
|
+
const branch = scope;
|
394
|
+
const parentBranch = branch.___closestBranch;
|
395
|
+
scope.___closestBranch = branch;
|
396
|
+
if (parentBranch) {
|
397
|
+
branch.___parentBranch = parentBranch;
|
398
|
+
(parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(
|
399
|
+
branch
|
400
|
+
);
|
401
|
+
}
|
394
402
|
}
|
395
403
|
}
|
396
404
|
if (true) {
|
@@ -1767,6 +1775,7 @@ function renderCatch(scope, error) {
|
|
1767
1775
|
}
|
1768
1776
|
function conditional(nodeAccessor, ...branches) {
|
1769
1777
|
const branchAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
|
1778
|
+
enableBranches();
|
1770
1779
|
return (scope, newBranch) => {
|
1771
1780
|
if (newBranch !== scope[branchAccessor]) {
|
1772
1781
|
setConditionalRenderer(
|
@@ -1784,6 +1793,7 @@ function patchDynamicTag(fn) {
|
|
1784
1793
|
var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
1785
1794
|
const childScopeAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
|
1786
1795
|
const rendererAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
|
1796
|
+
enableBranches();
|
1787
1797
|
return (scope, newRenderer, getInput) => {
|
1788
1798
|
const normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
1789
1799
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.___id || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) {
|
@@ -1903,6 +1913,7 @@ function loopTo(nodeAccessor, renderer) {
|
|
1903
1913
|
}
|
1904
1914
|
function loop(nodeAccessor, renderer, forEach) {
|
1905
1915
|
const params = renderer.___params;
|
1916
|
+
enableBranches();
|
1906
1917
|
return (scope, value2) => {
|
1907
1918
|
const referenceNode = scope[nodeAccessor];
|
1908
1919
|
const oldMap = scope["LoopScopeMap:" /* LoopScopeMap */ + nodeAccessor];
|
@@ -2069,6 +2080,7 @@ var runRender = (render) => render.___signal(render.___scope, render.___value);
|
|
2069
2080
|
var enableCatch = () => {
|
2070
2081
|
enableCatch = () => {
|
2071
2082
|
};
|
2083
|
+
enableBranches();
|
2072
2084
|
const handlePendingTry = (fn, scope, branch) => {
|
2073
2085
|
while (branch) {
|
2074
2086
|
if (branch.___pendingAsyncCount) {
|
package/dist/debug/dom.mjs
CHANGED
@@ -154,6 +154,10 @@ var DEFAULT_RENDER_ID = "_";
|
|
154
154
|
|
155
155
|
// src/dom/resume.ts
|
156
156
|
var registeredValues = {};
|
157
|
+
var branchesEnabled;
|
158
|
+
function enableBranches() {
|
159
|
+
branchesEnabled = 1;
|
160
|
+
}
|
157
161
|
function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
158
162
|
if (true) {
|
159
163
|
if (!runtimeId.match(/^[_$a-z][_$a-z0-9]*$/i)) {
|
@@ -220,41 +224,43 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
220
224
|
if (token === "*" /* Node */) {
|
221
225
|
const node = scope[data2] = visit.previousSibling;
|
222
226
|
scope["Getter:" /* Getter */ + data2] = () => node;
|
223
|
-
} else if (
|
224
|
-
if (
|
225
|
-
|
227
|
+
} else if (branchesEnabled) {
|
228
|
+
if (token === "[" /* BranchStart */) {
|
229
|
+
if (currentBranchId && dataIndex) {
|
230
|
+
branchEnd(currentBranchId, visit);
|
231
|
+
currentBranchId = branchStack.pop();
|
232
|
+
}
|
233
|
+
if (currentBranchId) {
|
234
|
+
branchStack.push(currentBranchId);
|
235
|
+
parentBranchIds.set(scopeId, currentBranchId);
|
236
|
+
}
|
237
|
+
currentBranchId = scopeId;
|
238
|
+
scope.___startNode = visit;
|
239
|
+
} else if (token === "]" /* BranchEnd */) {
|
240
|
+
scope[data2] = visit;
|
241
|
+
const curParent = visit.parentNode;
|
242
|
+
const startNode = branchEnd(
|
243
|
+
currentBranchId,
|
244
|
+
visit
|
245
|
+
).___startNode;
|
246
|
+
if (curParent !== startNode.parentNode) {
|
247
|
+
curParent.prepend(startNode);
|
248
|
+
}
|
226
249
|
currentBranchId = branchStack.pop();
|
227
|
-
}
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
if (curParent !== startNode.parentNode) {
|
242
|
-
curParent.prepend(startNode);
|
243
|
-
}
|
244
|
-
currentBranchId = branchStack.pop();
|
245
|
-
} else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
|
246
|
-
let next = data2.indexOf(" ");
|
247
|
-
let curNode = visit;
|
248
|
-
scope[~next ? data2.slice(0, next) : data2] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit;
|
249
|
-
while (~next) {
|
250
|
-
const start = next + 1;
|
251
|
-
next = data2.indexOf(" ", start);
|
252
|
-
const childScopeId = +data2.slice(
|
253
|
-
start,
|
254
|
-
~next ? next : data2.length
|
255
|
-
);
|
256
|
-
curNode = branchEnd(childScopeId, curNode).___endNode;
|
257
|
-
parentBranchIds.set(childScopeId, scopeId);
|
250
|
+
} else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
|
251
|
+
let next = data2.indexOf(" ");
|
252
|
+
let curNode = visit;
|
253
|
+
scope[~next ? data2.slice(0, next) : data2] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit;
|
254
|
+
while (~next) {
|
255
|
+
const start = next + 1;
|
256
|
+
next = data2.indexOf(" ", start);
|
257
|
+
const childScopeId = +data2.slice(
|
258
|
+
start,
|
259
|
+
~next ? next : data2.length
|
260
|
+
);
|
261
|
+
curNode = branchEnd(childScopeId, curNode).___endNode;
|
262
|
+
parentBranchIds.set(childScopeId, scopeId);
|
263
|
+
}
|
258
264
|
}
|
259
265
|
}
|
260
266
|
}
|
@@ -286,19 +292,21 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
286
292
|
prevScope
|
287
293
|
);
|
288
294
|
}
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
295
|
+
if (branchesEnabled) {
|
296
|
+
const parentBranchId = scope["#ClosestBranchId" /* ClosestBranchId */] || parentBranchIds.get(scopeId);
|
297
|
+
if (parentBranchId) {
|
298
|
+
scope.___closestBranch = scopeLookup[parentBranchId];
|
299
|
+
}
|
300
|
+
if (branchIds.has(scopeId)) {
|
301
|
+
const branch = scope;
|
302
|
+
const parentBranch = branch.___closestBranch;
|
303
|
+
scope.___closestBranch = branch;
|
304
|
+
if (parentBranch) {
|
305
|
+
branch.___parentBranch = parentBranch;
|
306
|
+
(parentBranch.___branchScopes ||= /* @__PURE__ */ new Set()).add(
|
307
|
+
branch
|
308
|
+
);
|
309
|
+
}
|
302
310
|
}
|
303
311
|
}
|
304
312
|
if (true) {
|
@@ -1675,6 +1683,7 @@ function renderCatch(scope, error) {
|
|
1675
1683
|
}
|
1676
1684
|
function conditional(nodeAccessor, ...branches) {
|
1677
1685
|
const branchAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
|
1686
|
+
enableBranches();
|
1678
1687
|
return (scope, newBranch) => {
|
1679
1688
|
if (newBranch !== scope[branchAccessor]) {
|
1680
1689
|
setConditionalRenderer(
|
@@ -1692,6 +1701,7 @@ function patchDynamicTag(fn) {
|
|
1692
1701
|
var dynamicTag = function dynamicTag2(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
1693
1702
|
const childScopeAccessor = "ConditionalScope:" /* ConditionalScope */ + nodeAccessor;
|
1694
1703
|
const rendererAccessor = "ConditionalRenderer:" /* ConditionalRenderer */ + nodeAccessor;
|
1704
|
+
enableBranches();
|
1695
1705
|
return (scope, newRenderer, getInput) => {
|
1696
1706
|
const normalizedRenderer = normalizeDynamicRenderer(newRenderer);
|
1697
1707
|
if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.___id || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor])) {
|
@@ -1811,6 +1821,7 @@ function loopTo(nodeAccessor, renderer) {
|
|
1811
1821
|
}
|
1812
1822
|
function loop(nodeAccessor, renderer, forEach) {
|
1813
1823
|
const params = renderer.___params;
|
1824
|
+
enableBranches();
|
1814
1825
|
return (scope, value2) => {
|
1815
1826
|
const referenceNode = scope[nodeAccessor];
|
1816
1827
|
const oldMap = scope["LoopScopeMap:" /* LoopScopeMap */ + nodeAccessor];
|
@@ -1977,6 +1988,7 @@ var runRender = (render) => render.___signal(render.___scope, render.___value);
|
|
1977
1988
|
var enableCatch = () => {
|
1978
1989
|
enableCatch = () => {
|
1979
1990
|
};
|
1991
|
+
enableBranches();
|
1980
1992
|
const handlePendingTry = (fn, scope, branch) => {
|
1981
1993
|
while (branch) {
|
1982
1994
|
if (branch.___pendingAsyncCount) {
|
package/dist/debug/html.js
CHANGED
@@ -1790,7 +1790,7 @@ var branchIdKey = Symbol();
|
|
1790
1790
|
function withBranchId(branchId, cb) {
|
1791
1791
|
return withContext(branchIdKey, branchId, cb);
|
1792
1792
|
}
|
1793
|
-
function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1793
|
+
function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
|
1794
1794
|
const resumeBranch = serializeBranch !== 0;
|
1795
1795
|
const resumeMarker = serializeMarker !== 0;
|
1796
1796
|
if (resumeBranch) {
|
@@ -1818,16 +1818,18 @@ function resumeForOf(list, cb, by, scopeId, accessor, serializeBranch, serialize
|
|
1818
1818
|
} else {
|
1819
1819
|
forOf(list, cb);
|
1820
1820
|
}
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1821
|
+
writeBranchEnd(
|
1822
|
+
scopeId,
|
1823
|
+
accessor,
|
1824
|
+
resumeMarker,
|
1825
|
+
parentEndTag,
|
1826
|
+
resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
|
1827
|
+
"]" /* BranchEnd */,
|
1828
|
+
scopeId + " " + accessor
|
1829
|
+
)
|
1830
|
+
);
|
1829
1831
|
}
|
1830
|
-
function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker,
|
1832
|
+
function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
|
1831
1833
|
const resumeBranch = serializeBranch !== 0;
|
1832
1834
|
const resumeMarker = serializeMarker !== 0;
|
1833
1835
|
let branchIds = "";
|
@@ -1851,16 +1853,18 @@ function resumeSingleNodeForOf(list, cb, by, scopeId, accessor, serializeBranch,
|
|
1851
1853
|
} else {
|
1852
1854
|
forOf(list, cb);
|
1853
1855
|
}
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1856
|
+
writeBranchEnd(
|
1857
|
+
scopeId,
|
1858
|
+
accessor,
|
1859
|
+
resumeMarker,
|
1860
|
+
parentEndTag,
|
1861
|
+
resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
|
1862
|
+
parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1863
|
+
scopeId + " " + accessor + branchIds
|
1864
|
+
)
|
1865
|
+
);
|
1862
1866
|
}
|
1863
|
-
function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1867
|
+
function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
|
1864
1868
|
const resumeBranch = serializeBranch !== 0;
|
1865
1869
|
const resumeMarker = serializeMarker !== 0;
|
1866
1870
|
if (resumeBranch) {
|
@@ -1887,16 +1891,18 @@ function resumeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeM
|
|
1887
1891
|
} else {
|
1888
1892
|
forIn(obj, cb);
|
1889
1893
|
}
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1894
|
+
writeBranchEnd(
|
1895
|
+
scopeId,
|
1896
|
+
accessor,
|
1897
|
+
resumeMarker,
|
1898
|
+
parentEndTag,
|
1899
|
+
resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
|
1900
|
+
"]" /* BranchEnd */,
|
1901
|
+
scopeId + " " + accessor
|
1902
|
+
)
|
1903
|
+
);
|
1898
1904
|
}
|
1899
|
-
function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker,
|
1905
|
+
function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
|
1900
1906
|
const resumeBranch = serializeBranch !== 0;
|
1901
1907
|
const resumeMarker = serializeMarker !== 0;
|
1902
1908
|
let branchIds = "";
|
@@ -1920,16 +1926,18 @@ function resumeSingleNodeForIn(obj, cb, by, scopeId, accessor, serializeBranch,
|
|
1920
1926
|
} else {
|
1921
1927
|
forIn(obj, cb);
|
1922
1928
|
}
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1929
|
+
writeBranchEnd(
|
1930
|
+
scopeId,
|
1931
|
+
accessor,
|
1932
|
+
resumeMarker,
|
1933
|
+
parentEndTag,
|
1934
|
+
resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
|
1935
|
+
parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
1936
|
+
scopeId + " " + accessor + branchIds
|
1937
|
+
)
|
1938
|
+
);
|
1931
1939
|
}
|
1932
|
-
function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker) {
|
1940
|
+
function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
|
1933
1941
|
const resumeBranch = serializeBranch !== 0;
|
1934
1942
|
const resumeMarker = serializeMarker !== 0;
|
1935
1943
|
if (resumeBranch) {
|
@@ -1956,16 +1964,18 @@ function resumeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch,
|
|
1956
1964
|
} else {
|
1957
1965
|
forTo(to, from, step, cb);
|
1958
1966
|
}
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
+
writeBranchEnd(
|
1968
|
+
scopeId,
|
1969
|
+
accessor,
|
1970
|
+
resumeMarker,
|
1971
|
+
parentEndTag,
|
1972
|
+
resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
|
1973
|
+
"]" /* BranchEnd */,
|
1974
|
+
scopeId + " " + accessor
|
1975
|
+
)
|
1976
|
+
);
|
1967
1977
|
}
|
1968
|
-
function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker,
|
1978
|
+
function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
|
1969
1979
|
const resumeBranch = serializeBranch !== 0;
|
1970
1980
|
const resumeMarker = serializeMarker !== 0;
|
1971
1981
|
let branchIds = "";
|
@@ -1989,16 +1999,18 @@ function resumeSingleNodeForTo(to, from, step, cb, by, scopeId, accessor, serial
|
|
1989
1999
|
} else {
|
1990
2000
|
forTo(to, from, step, cb);
|
1991
2001
|
}
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1999
|
-
|
2002
|
+
writeBranchEnd(
|
2003
|
+
scopeId,
|
2004
|
+
accessor,
|
2005
|
+
resumeMarker,
|
2006
|
+
parentEndTag,
|
2007
|
+
resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
|
2008
|
+
parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
2009
|
+
scopeId + " " + accessor + branchIds
|
2010
|
+
)
|
2011
|
+
);
|
2000
2012
|
}
|
2001
|
-
function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker) {
|
2013
|
+
function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
|
2002
2014
|
const resumeBranch = serializeBranch !== 0;
|
2003
2015
|
const resumeMarker = serializeMarker !== 0;
|
2004
2016
|
const branchId = peekNextScopeId();
|
@@ -2015,16 +2027,18 @@ function resumeConditional(cb, scopeId, accessor, serializeBranch, serializeMark
|
|
2015
2027
|
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
2016
2028
|
});
|
2017
2029
|
}
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
2030
|
+
writeBranchEnd(
|
2031
|
+
scopeId,
|
2032
|
+
accessor,
|
2033
|
+
resumeMarker,
|
2034
|
+
parentEndTag,
|
2035
|
+
resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
|
2036
|
+
"]" /* BranchEnd */,
|
2037
|
+
scopeId + " " + accessor
|
2038
|
+
)
|
2039
|
+
);
|
2026
2040
|
}
|
2027
|
-
function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker,
|
2041
|
+
function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, serializeMarker, parentEndTag) {
|
2028
2042
|
const resumeBranch = serializeBranch !== 0;
|
2029
2043
|
const resumeMarker = serializeMarker !== 0;
|
2030
2044
|
const branchId = peekNextScopeId();
|
@@ -2036,13 +2050,27 @@ function resumeSingleNodeConditional(cb, scopeId, accessor, serializeBranch, ser
|
|
2036
2050
|
["ConditionalScope:" /* ConditionalScope */ + accessor]: writeScope(branchId, {})
|
2037
2051
|
});
|
2038
2052
|
}
|
2053
|
+
writeBranchEnd(
|
2054
|
+
scopeId,
|
2055
|
+
accessor,
|
2056
|
+
resumeMarker,
|
2057
|
+
parentEndTag,
|
2058
|
+
resumeMarker && (!parentEndTag || resumeBranch) && $chunk.boundary.state.mark(
|
2059
|
+
parentEndTag ? "=" /* BranchSingleNodeOnlyChildInParent */ : "|" /* BranchSingleNode */,
|
2060
|
+
scopeId + " " + accessor + (shouldWriteBranch ? " " + branchId : "")
|
2061
|
+
)
|
2062
|
+
);
|
2063
|
+
}
|
2064
|
+
function writeBranchEnd(scopeId, accessor, resumeMarker, parentEndTag, mark) {
|
2065
|
+
const endTag = parentEndTag || "";
|
2039
2066
|
if (resumeMarker) {
|
2040
|
-
|
2041
|
-
$chunk.
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2067
|
+
if (mark) {
|
2068
|
+
$chunk.writeHTML(mark + endTag);
|
2069
|
+
} else {
|
2070
|
+
$chunk.writeHTML(endTag + markResumeNode(scopeId, accessor));
|
2071
|
+
}
|
2072
|
+
} else {
|
2073
|
+
$chunk.writeHTML(endTag);
|
2046
2074
|
}
|
2047
2075
|
}
|
2048
2076
|
var writeScope = (scopeId, partialScope) => {
|