marko 6.0.0-next.3.19 → 6.0.0-next.3.21
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/translator/index.js +10 -5
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
@@ -3810,6 +3810,7 @@ function getMemberExpressionPropString(expr) {
|
|
3810
3810
|
case "NumericLiteral":
|
3811
3811
|
return "" + expr.property.value;
|
3812
3812
|
case "Identifier":
|
3813
|
+
if (expr.computed) return;
|
3813
3814
|
return expr.property.name;
|
3814
3815
|
}
|
3815
3816
|
}
|
@@ -4424,7 +4425,7 @@ var native_tag_default = {
|
|
4424
4425
|
if (node.var) {
|
4425
4426
|
for (const ref of tag.scope.getBinding(node.var.name).referencePaths) {
|
4426
4427
|
setReferencesScope(ref);
|
4427
|
-
if (!ref
|
4428
|
+
if (!isInvokedFunction(ref)) {
|
4428
4429
|
tagExtra[kGetterId] = getRegisterUID(section, bindingName);
|
4429
4430
|
break;
|
4430
4431
|
}
|
@@ -4497,7 +4498,7 @@ var native_tag_default = {
|
|
4497
4498
|
}
|
4498
4499
|
for (const reference of references) {
|
4499
4500
|
const referenceSection = getSection(reference);
|
4500
|
-
if (reference
|
4501
|
+
if (isInvokedFunction(reference)) {
|
4501
4502
|
reference.parentPath.replaceWith(
|
4502
4503
|
import_compiler28.types.expressionStatement(
|
4503
4504
|
createScopeReadExpression(referenceSection, nodeRef2)
|
@@ -4887,6 +4888,10 @@ function isChangeHandler(propName) {
|
|
4887
4888
|
function buildUndefined() {
|
4888
4889
|
return import_compiler28.types.unaryExpression("void", import_compiler28.types.numericLiteral(0));
|
4889
4890
|
}
|
4891
|
+
function isInvokedFunction(expr) {
|
4892
|
+
const { parent, node } = expr;
|
4893
|
+
return parent.type === "CallExpression" && parent.callee === node;
|
4894
|
+
}
|
4890
4895
|
|
4891
4896
|
// src/translator/core/for.ts
|
4892
4897
|
var kForMarkerBinding = Symbol("for marker binding");
|
@@ -8490,9 +8495,9 @@ function translateDOM(tag) {
|
|
8490
8495
|
node.var.extra.binding
|
8491
8496
|
);
|
8492
8497
|
source.register = true;
|
8493
|
-
source.buildAssignment = (
|
8498
|
+
source.buildAssignment = (valueSection, value) => {
|
8494
8499
|
return import_compiler51.types.callExpression(importRuntime("tagVarSignalChange"), [
|
8495
|
-
createScopeReadExpression(
|
8500
|
+
createScopeReadExpression(valueSection, childScopeBinding),
|
8496
8501
|
value
|
8497
8502
|
]);
|
8498
8503
|
};
|
@@ -9203,7 +9208,7 @@ var tag_default = {
|
|
9203
9208
|
);
|
9204
9209
|
}
|
9205
9210
|
tag.node.attributes.splice(
|
9206
|
-
|
9211
|
+
i + 1,
|
9207
9212
|
0,
|
9208
9213
|
import_compiler53.types.markoAttribute(attr2.node.name + "Change", changeValue)
|
9209
9214
|
);
|