marko 6.0.41 → 6.0.43
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 +4 -4
- package/dist/debug/dom.mjs +4 -4
- package/dist/debug/html.js +4 -4
- package/dist/debug/html.mjs +4 -4
- package/dist/dom.js +10 -13
- package/dist/dom.mjs +10 -13
- package/dist/html.js +8 -11
- package/dist/html.mjs +8 -11
- package/dist/translator/index.js +29 -18
- package/dist/translator/util/is-invoked-function.d.ts +1 -1
- package/package.json +2 -2
package/dist/debug/dom.js
CHANGED
@@ -273,7 +273,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
273
273
|
let resumeRender;
|
274
274
|
const initRuntime = (renders2) => {
|
275
275
|
defineRuntime({
|
276
|
-
value: resumeRender = (renderId) => {
|
276
|
+
value: resumeRender = ((renderId) => {
|
277
277
|
const render = resumeRender[renderId] = renders2[renderId] || renders2(renderId);
|
278
278
|
const walk2 = render.w;
|
279
279
|
const commentPrefixLen = render.i.length;
|
@@ -432,7 +432,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
432
432
|
}
|
433
433
|
};
|
434
434
|
return render;
|
435
|
-
}
|
435
|
+
})
|
436
436
|
});
|
437
437
|
};
|
438
438
|
if (renders) {
|
@@ -969,7 +969,7 @@ function dynamicClosure(...closureSignals) {
|
|
969
969
|
}
|
970
970
|
function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
971
971
|
const childSignal = closure(valueAccessor, fn, getOwnerScope);
|
972
|
-
const closureSignal = (scope) => {
|
972
|
+
const closureSignal = ((scope) => {
|
973
973
|
scope[closureSignal.___signalIndexAccessor] = closureSignal.___index;
|
974
974
|
childSignal(scope);
|
975
975
|
subscribeToScopeSet(
|
@@ -977,7 +977,7 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
977
977
|
closureSignal.___scopeInstancesAccessor,
|
978
978
|
scope
|
979
979
|
);
|
980
|
-
};
|
980
|
+
});
|
981
981
|
closureSignal.___scopeInstancesAccessor = "ClosureScopes:" /* ClosureScopes */ + valueAccessor;
|
982
982
|
closureSignal.___signalIndexAccessor = "ClosureSignalIndex:" /* ClosureSignalIndex */ + valueAccessor;
|
983
983
|
return closureSignal;
|
package/dist/debug/dom.mjs
CHANGED
@@ -177,7 +177,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
177
177
|
let resumeRender;
|
178
178
|
const initRuntime = (renders2) => {
|
179
179
|
defineRuntime({
|
180
|
-
value: resumeRender = (renderId) => {
|
180
|
+
value: resumeRender = ((renderId) => {
|
181
181
|
const render = resumeRender[renderId] = renders2[renderId] || renders2(renderId);
|
182
182
|
const walk2 = render.w;
|
183
183
|
const commentPrefixLen = render.i.length;
|
@@ -336,7 +336,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
336
336
|
}
|
337
337
|
};
|
338
338
|
return render;
|
339
|
-
}
|
339
|
+
})
|
340
340
|
});
|
341
341
|
};
|
342
342
|
if (renders) {
|
@@ -873,7 +873,7 @@ function dynamicClosure(...closureSignals) {
|
|
873
873
|
}
|
874
874
|
function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
875
875
|
const childSignal = closure(valueAccessor, fn, getOwnerScope);
|
876
|
-
const closureSignal = (scope) => {
|
876
|
+
const closureSignal = ((scope) => {
|
877
877
|
scope[closureSignal.___signalIndexAccessor] = closureSignal.___index;
|
878
878
|
childSignal(scope);
|
879
879
|
subscribeToScopeSet(
|
@@ -881,7 +881,7 @@ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
|
881
881
|
closureSignal.___scopeInstancesAccessor,
|
882
882
|
scope
|
883
883
|
);
|
884
|
-
};
|
884
|
+
});
|
885
885
|
closureSignal.___scopeInstancesAccessor = "ClosureScopes:" /* ClosureScopes */ + valueAccessor;
|
886
886
|
closureSignal.___signalIndexAccessor = "ClosureSignalIndex:" /* ClosureSignalIndex */ + valueAccessor;
|
887
887
|
return closureSignal;
|
package/dist/debug/html.js
CHANGED
@@ -331,10 +331,10 @@ runtime.x = (op, id, node, start, placeholderCallback) => {
|
|
331
331
|
// src/html/serializer.ts
|
332
332
|
var kTouchedIterator = Symbol();
|
333
333
|
var { hasOwnProperty } = {};
|
334
|
-
var Generator = function* () {
|
335
|
-
}().constructor;
|
336
|
-
var AsyncGenerator = async function* () {
|
337
|
-
}().constructor;
|
334
|
+
var Generator = (function* () {
|
335
|
+
})().constructor;
|
336
|
+
var AsyncGenerator = (async function* () {
|
337
|
+
})().constructor;
|
338
338
|
patchIteratorNext(Generator.prototype);
|
339
339
|
patchIteratorNext(AsyncGenerator.prototype);
|
340
340
|
var REGISTRY = /* @__PURE__ */ new WeakMap();
|
package/dist/debug/html.mjs
CHANGED
@@ -247,10 +247,10 @@ runtime.x = (op, id, node, start, placeholderCallback) => {
|
|
247
247
|
// src/html/serializer.ts
|
248
248
|
var kTouchedIterator = Symbol();
|
249
249
|
var { hasOwnProperty } = {};
|
250
|
-
var Generator = function* () {
|
251
|
-
}().constructor;
|
252
|
-
var AsyncGenerator = async function* () {
|
253
|
-
}().constructor;
|
250
|
+
var Generator = (function* () {
|
251
|
+
})().constructor;
|
252
|
+
var AsyncGenerator = (async function* () {
|
253
|
+
})().constructor;
|
254
254
|
patchIteratorNext(Generator.prototype);
|
255
255
|
patchIteratorNext(AsyncGenerator.prototype);
|
256
256
|
var REGISTRY = /* @__PURE__ */ new WeakMap();
|
package/dist/dom.js
CHANGED
@@ -201,18 +201,15 @@ function stripSpacesAndPunctuation(str) {
|
|
201
201
|
return str.replace(/[^\p{L}\p{N}]/gu, "");
|
202
202
|
}
|
203
203
|
|
204
|
-
// src/common/meta.ts
|
205
|
-
var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
|
206
|
-
|
207
204
|
// src/dom/resume.ts
|
208
205
|
var registeredValues = {}, branchesEnabled;
|
209
206
|
function enableBranches() {
|
210
207
|
branchesEnabled = 1;
|
211
208
|
}
|
212
|
-
function init(runtimeId =
|
209
|
+
function init(runtimeId = "M") {
|
213
210
|
let renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), resumeRender, initRuntime = (renders2) => {
|
214
211
|
defineRuntime({
|
215
|
-
value: resumeRender = (renderId) => {
|
212
|
+
value: resumeRender = ((renderId) => {
|
216
213
|
let render = resumeRender[renderId] = renders2[renderId] || renders2(renderId), walk2 = render.w, commentPrefixLen = render.i.length, scopeLookup = render.s = {}, serializeContext = {
|
217
214
|
_: registeredValues
|
218
215
|
}, branches = branchesEnabled && /* @__PURE__ */ (() => {
|
@@ -283,7 +280,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
283
280
|
isResuming = visits.length = resumes.length = 0;
|
284
281
|
}
|
285
282
|
}, render;
|
286
|
-
}
|
283
|
+
})
|
287
284
|
});
|
288
285
|
};
|
289
286
|
if (renders) {
|
@@ -631,13 +628,13 @@ function dynamicClosure(...closureSignals) {
|
|
631
628
|
};
|
632
629
|
}
|
633
630
|
function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
634
|
-
let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = (scope) => {
|
631
|
+
let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = ((scope) => {
|
635
632
|
scope[closureSignal.F] = closureSignal.L, childSignal(scope), subscribeToScopeSet(
|
636
633
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
637
634
|
closureSignal.E,
|
638
635
|
scope
|
639
636
|
);
|
640
|
-
};
|
637
|
+
});
|
641
638
|
return closureSignal.E = "a" /* ClosureScopes */ + valueAccessor, closureSignal.F = "b" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
|
642
639
|
}
|
643
640
|
function closure(valueAccessor, fn, getOwnerScope) {
|
@@ -1432,7 +1429,7 @@ function abort(ctrl) {
|
|
1432
1429
|
}
|
1433
1430
|
|
1434
1431
|
// src/common/compat-meta.ts
|
1435
|
-
var
|
1432
|
+
var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
|
1436
1433
|
|
1437
1434
|
// src/dom/compat.ts
|
1438
1435
|
var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
@@ -1513,13 +1510,13 @@ function mount(input = {}, reference, position) {
|
|
1513
1510
|
let branch, parentNode = reference, nextSibling = null, { $global } = input;
|
1514
1511
|
switch ($global ? ({ $global, ...input } = input, $global = {
|
1515
1512
|
q: 0,
|
1516
|
-
runtimeId:
|
1517
|
-
renderId:
|
1513
|
+
runtimeId: "M",
|
1514
|
+
renderId: "_",
|
1518
1515
|
...$global
|
1519
1516
|
}) : $global = {
|
1520
1517
|
q: 0,
|
1521
|
-
runtimeId:
|
1522
|
-
renderId:
|
1518
|
+
runtimeId: "M",
|
1519
|
+
renderId: "_"
|
1523
1520
|
}, position) {
|
1524
1521
|
case "beforebegin":
|
1525
1522
|
parentNode = reference.parentNode, nextSibling = reference;
|
package/dist/dom.mjs
CHANGED
@@ -108,18 +108,15 @@ function stripSpacesAndPunctuation(str) {
|
|
108
108
|
return str.replace(/[^\p{L}\p{N}]/gu, "");
|
109
109
|
}
|
110
110
|
|
111
|
-
// src/common/meta.ts
|
112
|
-
var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
|
113
|
-
|
114
111
|
// src/dom/resume.ts
|
115
112
|
var registeredValues = {}, branchesEnabled;
|
116
113
|
function enableBranches() {
|
117
114
|
branchesEnabled = 1;
|
118
115
|
}
|
119
|
-
function init(runtimeId =
|
116
|
+
function init(runtimeId = "M") {
|
120
117
|
let renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), resumeRender, initRuntime = (renders2) => {
|
121
118
|
defineRuntime({
|
122
|
-
value: resumeRender = (renderId) => {
|
119
|
+
value: resumeRender = ((renderId) => {
|
123
120
|
let render = resumeRender[renderId] = renders2[renderId] || renders2(renderId), walk2 = render.w, commentPrefixLen = render.i.length, scopeLookup = render.s = {}, serializeContext = {
|
124
121
|
_: registeredValues
|
125
122
|
}, branches = branchesEnabled && /* @__PURE__ */ (() => {
|
@@ -190,7 +187,7 @@ function init(runtimeId = DEFAULT_RUNTIME_ID) {
|
|
190
187
|
isResuming = visits.length = resumes.length = 0;
|
191
188
|
}
|
192
189
|
}, render;
|
193
|
-
}
|
190
|
+
})
|
194
191
|
});
|
195
192
|
};
|
196
193
|
if (renders) {
|
@@ -538,13 +535,13 @@ function dynamicClosure(...closureSignals) {
|
|
538
535
|
};
|
539
536
|
}
|
540
537
|
function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
|
541
|
-
let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = (scope) => {
|
538
|
+
let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = ((scope) => {
|
542
539
|
scope[closureSignal.F] = closureSignal.L, childSignal(scope), subscribeToScopeSet(
|
543
540
|
getOwnerScope ? getOwnerScope(scope) : scope._,
|
544
541
|
closureSignal.E,
|
545
542
|
scope
|
546
543
|
);
|
547
|
-
};
|
544
|
+
});
|
548
545
|
return closureSignal.E = "a" /* ClosureScopes */ + valueAccessor, closureSignal.F = "b" /* ClosureSignalIndex */ + valueAccessor, closureSignal;
|
549
546
|
}
|
550
547
|
function closure(valueAccessor, fn, getOwnerScope) {
|
@@ -1339,7 +1336,7 @@ function abort(ctrl) {
|
|
1339
1336
|
}
|
1340
1337
|
|
1341
1338
|
// src/common/compat-meta.ts
|
1342
|
-
var
|
1339
|
+
var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
|
1343
1340
|
|
1344
1341
|
// src/dom/compat.ts
|
1345
1342
|
var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
@@ -1420,13 +1417,13 @@ function mount(input = {}, reference, position) {
|
|
1420
1417
|
let branch, parentNode = reference, nextSibling = null, { $global } = input;
|
1421
1418
|
switch ($global ? ({ $global, ...input } = input, $global = {
|
1422
1419
|
q: 0,
|
1423
|
-
runtimeId:
|
1424
|
-
renderId:
|
1420
|
+
runtimeId: "M",
|
1421
|
+
renderId: "_",
|
1425
1422
|
...$global
|
1426
1423
|
}) : $global = {
|
1427
1424
|
q: 0,
|
1428
|
-
runtimeId:
|
1429
|
-
renderId:
|
1425
|
+
runtimeId: "M",
|
1426
|
+
renderId: "_"
|
1430
1427
|
}, position) {
|
1431
1428
|
case "beforebegin":
|
1432
1429
|
parentNode = reference.parentNode, nextSibling = reference;
|
package/dist/html.js
CHANGED
@@ -183,9 +183,9 @@ function forToBy(by, index) {
|
|
183
183
|
var WALKER_RUNTIME_CODE = '(e=>(self[e]=(l,d=e+l,f=d.length,o={},n=[],s=document,t=s.createTreeWalker(s,129))=>s=self[e][l]={i:d,d:s,l:o,v:n,x(){},w(e,l,x){for(;e=t.nextNode();)s.x(l=(l=e.data)&&!l.indexOf(d)&&(o[x=l.slice(f+1)]=e,l[f]),x,e),l>"#"&&n.push(e)}},self[e]))', REORDER_RUNTIME_CODE = '(e=>{let i,l,t,r={},c=(e,i)=>{e.replaceWith(...i.childNodes),i.remove()};e.d.head.append(e.d.querySelector("style["+e.i+"]")||""),e.j={},e.x=(d,o,n,a,g)=>{"#"==d?(r[o]=l).i++:n==t&&i(),"T"==n.tagName&&(o=n.getAttribute(e.i))&&((a=e.l["^"+o])&&(r[o]={i:1,c(i=e.l[o]||n){for(;(t=i.previousSibling||a).remove(),a!=t;);c(i,n)}}),t=n.nextSibling,l=r[o],i=()=>{a||c(e.l[o],n),--l.i||l.c()},(d=e.j[o])&&(g=l.c,l.c=()=>g()+d(e.r)))}})';
|
184
184
|
|
185
185
|
// src/html/serializer.ts
|
186
|
-
var kTouchedIterator = Symbol(), { hasOwnProperty } = {}, Generator = function* () {
|
187
|
-
}().constructor, AsyncGenerator = async function* () {
|
188
|
-
}().constructor;
|
186
|
+
var kTouchedIterator = Symbol(), { hasOwnProperty } = {}, Generator = (function* () {
|
187
|
+
})().constructor, AsyncGenerator = (async function* () {
|
188
|
+
})().constructor;
|
189
189
|
patchIteratorNext(Generator.prototype);
|
190
190
|
patchIteratorNext(AsyncGenerator.prototype);
|
191
191
|
var REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = (() => {
|
@@ -1851,10 +1851,7 @@ function replaceUnsafeDoubleQuoteAttrChar(match) {
|
|
1851
1851
|
}
|
1852
1852
|
|
1853
1853
|
// src/common/compat-meta.ts
|
1854
|
-
var
|
1855
|
-
|
1856
|
-
// src/common/meta.ts
|
1857
|
-
var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
|
1854
|
+
var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
|
1858
1855
|
|
1859
1856
|
// src/html/template.ts
|
1860
1857
|
var createTemplate = (templateId, renderer) => (renderer.render = render, renderer._ = renderer, registerContent(templateId, renderer));
|
@@ -1864,10 +1861,10 @@ function isTemplate(renderer) {
|
|
1864
1861
|
function render(input = {}) {
|
1865
1862
|
let { $global: $global2 } = input;
|
1866
1863
|
$global2 ? ({ $global: $global2, ...input } = input, $global2 = {
|
1867
|
-
runtimeId:
|
1868
|
-
renderId:
|
1864
|
+
runtimeId: "M",
|
1865
|
+
renderId: "_",
|
1869
1866
|
...$global2
|
1870
|
-
}) : $global2 = { runtimeId:
|
1867
|
+
}) : $global2 = { runtimeId: "M", renderId: "_" };
|
1871
1868
|
let head = new Chunk(
|
1872
1869
|
new Boundary(new State2($global2), $global2.signal),
|
1873
1870
|
null,
|
@@ -2114,7 +2111,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
2114
2111
|
},
|
2115
2112
|
render(renderer, willRerender, classAPIOut, component, input) {
|
2116
2113
|
let $global2 = classAPIOut.global, state = $global2[K_TAGS_API_STATE] ||= getChunk()?.boundary.state;
|
2117
|
-
state || ($global2.runtimeId ||=
|
2114
|
+
state || ($global2.runtimeId ||= "M", $global2.renderId ||= $global2.componentIdPrefix || "_", $global2[K_TAGS_API_STATE] = state = new State2($global2));
|
2118
2115
|
let boundary = new Boundary(state), head = new Chunk(
|
2119
2116
|
boundary,
|
2120
2117
|
null,
|
package/dist/html.mjs
CHANGED
@@ -102,9 +102,9 @@ function forToBy(by, index) {
|
|
102
102
|
var WALKER_RUNTIME_CODE = '(e=>(self[e]=(l,d=e+l,f=d.length,o={},n=[],s=document,t=s.createTreeWalker(s,129))=>s=self[e][l]={i:d,d:s,l:o,v:n,x(){},w(e,l,x){for(;e=t.nextNode();)s.x(l=(l=e.data)&&!l.indexOf(d)&&(o[x=l.slice(f+1)]=e,l[f]),x,e),l>"#"&&n.push(e)}},self[e]))', REORDER_RUNTIME_CODE = '(e=>{let i,l,t,r={},c=(e,i)=>{e.replaceWith(...i.childNodes),i.remove()};e.d.head.append(e.d.querySelector("style["+e.i+"]")||""),e.j={},e.x=(d,o,n,a,g)=>{"#"==d?(r[o]=l).i++:n==t&&i(),"T"==n.tagName&&(o=n.getAttribute(e.i))&&((a=e.l["^"+o])&&(r[o]={i:1,c(i=e.l[o]||n){for(;(t=i.previousSibling||a).remove(),a!=t;);c(i,n)}}),t=n.nextSibling,l=r[o],i=()=>{a||c(e.l[o],n),--l.i||l.c()},(d=e.j[o])&&(g=l.c,l.c=()=>g()+d(e.r)))}})';
|
103
103
|
|
104
104
|
// src/html/serializer.ts
|
105
|
-
var kTouchedIterator = Symbol(), { hasOwnProperty } = {}, Generator = function* () {
|
106
|
-
}().constructor, AsyncGenerator = async function* () {
|
107
|
-
}().constructor;
|
105
|
+
var kTouchedIterator = Symbol(), { hasOwnProperty } = {}, Generator = (function* () {
|
106
|
+
})().constructor, AsyncGenerator = (async function* () {
|
107
|
+
})().constructor;
|
108
108
|
patchIteratorNext(Generator.prototype);
|
109
109
|
patchIteratorNext(AsyncGenerator.prototype);
|
110
110
|
var REGISTRY = /* @__PURE__ */ new WeakMap(), KNOWN_SYMBOLS = (() => {
|
@@ -1770,10 +1770,7 @@ function replaceUnsafeDoubleQuoteAttrChar(match) {
|
|
1770
1770
|
}
|
1771
1771
|
|
1772
1772
|
// src/common/compat-meta.ts
|
1773
|
-
var
|
1774
|
-
|
1775
|
-
// src/common/meta.ts
|
1776
|
-
var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
|
1773
|
+
var RENDERER_REGISTER_ID = "$C_r", SET_SCOPE_REGISTER_ID = "$C_s", RENDER_BODY_ID = "$C_b";
|
1777
1774
|
|
1778
1775
|
// src/html/template.ts
|
1779
1776
|
var createTemplate = (templateId, renderer) => (renderer.render = render, renderer._ = renderer, registerContent(templateId, renderer));
|
@@ -1783,10 +1780,10 @@ function isTemplate(renderer) {
|
|
1783
1780
|
function render(input = {}) {
|
1784
1781
|
let { $global: $global2 } = input;
|
1785
1782
|
$global2 ? ({ $global: $global2, ...input } = input, $global2 = {
|
1786
|
-
runtimeId:
|
1787
|
-
renderId:
|
1783
|
+
runtimeId: "M",
|
1784
|
+
renderId: "_",
|
1788
1785
|
...$global2
|
1789
|
-
}) : $global2 = { runtimeId:
|
1786
|
+
}) : $global2 = { runtimeId: "M", renderId: "_" };
|
1790
1787
|
let head = new Chunk(
|
1791
1788
|
new Boundary(new State2($global2), $global2.signal),
|
1792
1789
|
null,
|
@@ -2033,7 +2030,7 @@ var K_TAGS_API_STATE = Symbol(), COMPAT_REGISTRY = /* @__PURE__ */ new WeakMap()
|
|
2033
2030
|
},
|
2034
2031
|
render(renderer, willRerender, classAPIOut, component, input) {
|
2035
2032
|
let $global2 = classAPIOut.global, state = $global2[K_TAGS_API_STATE] ||= getChunk()?.boundary.state;
|
2036
|
-
state || ($global2.runtimeId ||=
|
2033
|
+
state || ($global2.runtimeId ||= "M", $global2.renderId ||= $global2.componentIdPrefix || "_", $global2[K_TAGS_API_STATE] = state = new State2($global2));
|
2037
2034
|
let boundary = new Boundary(state), head = new Chunk(
|
2038
2035
|
boundary,
|
2039
2036
|
null,
|
package/dist/translator/index.js
CHANGED
@@ -238,10 +238,10 @@ var import_babel_utils17 = require("@marko/compiler/babel-utils");
|
|
238
238
|
// src/html/serializer.ts
|
239
239
|
var kTouchedIterator = Symbol();
|
240
240
|
var { hasOwnProperty } = {};
|
241
|
-
var Generator = function* () {
|
242
|
-
}().constructor;
|
243
|
-
var AsyncGenerator = async function* () {
|
244
|
-
}().constructor;
|
241
|
+
var Generator = (function* () {
|
242
|
+
})().constructor;
|
243
|
+
var AsyncGenerator = (async function* () {
|
244
|
+
})().constructor;
|
245
245
|
patchIteratorNext(Generator.prototype);
|
246
246
|
patchIteratorNext(AsyncGenerator.prototype);
|
247
247
|
var KNOWN_SYMBOLS = (() => {
|
@@ -802,6 +802,7 @@ function getFnRoot(path5) {
|
|
802
802
|
fnPath = curPath;
|
803
803
|
} else {
|
804
804
|
switch (curPath.type) {
|
805
|
+
case "OptionalCallExpression":
|
805
806
|
case "CallExpression":
|
806
807
|
case "NewExpression":
|
807
808
|
fnPath = void 0;
|
@@ -850,6 +851,7 @@ function isInvokedFunction(expr) {
|
|
850
851
|
while (curPath) {
|
851
852
|
const { parent, node } = curPath;
|
852
853
|
switch (parent.type) {
|
854
|
+
case "OptionalCallExpression":
|
853
855
|
case "CallExpression":
|
854
856
|
return parent.callee === node;
|
855
857
|
case "TSNonNullExpression":
|
@@ -3412,24 +3414,33 @@ function generateSignalName(referencedBindings) {
|
|
3412
3414
|
return name2;
|
3413
3415
|
}
|
3414
3416
|
function replaceNullishAndEmptyFunctionsWith0(args) {
|
3415
|
-
|
3417
|
+
const len = args.length;
|
3418
|
+
let finalLen = void 0;
|
3419
|
+
for (let i = len; i--; ) {
|
3416
3420
|
const arg = args[i];
|
3417
3421
|
if (!arg) {
|
3418
3422
|
args[i] = import_compiler20.types.numericLiteral(0);
|
3419
|
-
|
3423
|
+
continue;
|
3424
|
+
}
|
3425
|
+
if (import_compiler20.types.isNullLiteral(arg) || import_compiler20.types.isUnaryExpression(arg) && arg.operator === "void") {
|
3426
|
+
args[i] = import_compiler20.types.numericLiteral(0);
|
3427
|
+
continue;
|
3428
|
+
}
|
3429
|
+
if (import_compiler20.types.isArrowFunctionExpression(arg) && import_compiler20.types.isBlockStatement(arg.body)) {
|
3420
3430
|
const body = arg.body.body;
|
3421
3431
|
if (body.length === 0) {
|
3422
3432
|
args[i] = import_compiler20.types.numericLiteral(0);
|
3423
|
-
|
3433
|
+
continue;
|
3434
|
+
}
|
3435
|
+
if (body.length === 1 && import_compiler20.types.isExpressionStatement(body[0])) {
|
3424
3436
|
arg.body = toParenthesizedExpressionIfNeeded(body[0].expression);
|
3425
3437
|
}
|
3426
|
-
}
|
3427
|
-
|
3438
|
+
}
|
3439
|
+
if (finalLen === void 0) {
|
3440
|
+
finalLen = i + 1;
|
3428
3441
|
}
|
3429
3442
|
}
|
3430
|
-
|
3431
|
-
args.length = i--;
|
3432
|
-
}
|
3443
|
+
args.length = finalLen || 0;
|
3433
3444
|
return args;
|
3434
3445
|
}
|
3435
3446
|
function addStatement(type, targetSection, referencedBindings, statement, usedReferences) {
|
@@ -5693,8 +5704,8 @@ var client_default = {
|
|
5693
5704
|
hub: { file }
|
5694
5705
|
} = tag;
|
5695
5706
|
const rawValue = node.rawValue;
|
5696
|
-
const code = rawValue.replace(/^client\s*/, "")
|
5697
|
-
const start = node.
|
5707
|
+
const code = rawValue.replace(/^client\s*/, "");
|
5708
|
+
const start = node.start + (rawValue.length - code.length);
|
5698
5709
|
let body = (0, import_babel_utils19.parseStatements)(file, code, start, start + code.length);
|
5699
5710
|
if (body.length === 1 && import_compiler26.types.isBlockStatement(body[0])) {
|
5700
5711
|
body = body[0].body;
|
@@ -9583,8 +9594,8 @@ var server_default = {
|
|
9583
9594
|
hub: { file }
|
9584
9595
|
} = tag;
|
9585
9596
|
const rawValue = node.rawValue;
|
9586
|
-
const code = rawValue.replace(/^server\s*/, "")
|
9587
|
-
const start = node.
|
9597
|
+
const code = rawValue.replace(/^server\s*/, "");
|
9598
|
+
const start = node.start + (rawValue.length - code.length);
|
9588
9599
|
let body = (0, import_babel_utils40.parseStatements)(file, code, start, start + code.length);
|
9589
9600
|
if (body.length === 1 && import_compiler47.types.isBlockStatement(body[0])) {
|
9590
9601
|
body = body[0].body;
|
@@ -9614,8 +9625,8 @@ var static_default = {
|
|
9614
9625
|
hub: { file }
|
9615
9626
|
} = tag;
|
9616
9627
|
const rawValue = node.rawValue;
|
9617
|
-
const code = rawValue.replace(/^static\s*/, "")
|
9618
|
-
const start = node.
|
9628
|
+
const code = rawValue.replace(/^static\s*/, "");
|
9629
|
+
const start = node.start + (rawValue.length - code.length);
|
9619
9630
|
let body = (0, import_babel_utils41.parseStatements)(file, code, start, start + code.length);
|
9620
9631
|
if (body.length === 1 && import_compiler48.types.isBlockStatement(body[0])) {
|
9621
9632
|
body = body[0].body;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
2
2
|
export default function isInvokedFunction(expr: t.NodePath<t.Node>): expr is typeof expr & {
|
3
|
-
parent: t.CallExpression;
|
3
|
+
parent: t.CallExpression | t.OptionalCallExpression;
|
4
4
|
parentPath: t.NodePath<t.CallExpression>;
|
5
5
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.43",
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
5
5
|
"keywords": [
|
6
6
|
"api",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"build": "node -r ~ts ./scripts/bundle.ts"
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
|
-
"@marko/compiler": "^5.39.
|
51
|
+
"@marko/compiler": "^5.39.32",
|
52
52
|
"csstype": "^3.1.3",
|
53
53
|
"magic-string": "^0.30.17"
|
54
54
|
},
|