marko 6.0.16 → 6.0.18
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 +25 -16
- package/package.json +1 -1
- package/tags-html.d.ts +2216 -159
package/dist/translator/index.js
CHANGED
@@ -4496,6 +4496,9 @@ function trackReferencesForBinding(babelBinding, binding) {
|
|
4496
4496
|
for (const referencePath of referencePaths) {
|
4497
4497
|
const referenceSection = getOrCreateSection(referencePath);
|
4498
4498
|
if (isSameOrChildSection(binding.section, referenceSection)) {
|
4499
|
+
if (binding.type === 4 /* local */ && referenceSection === binding.section) {
|
4500
|
+
continue;
|
4501
|
+
}
|
4499
4502
|
trackReference(referencePath, binding);
|
4500
4503
|
} else {
|
4501
4504
|
trackHoistedReference(referencePath, binding);
|
@@ -7668,7 +7671,7 @@ var html_script_default = {
|
|
7668
7671
|
const seen = {};
|
7669
7672
|
const { attributes } = tag.node;
|
7670
7673
|
let spreadReferenceNodes;
|
7671
|
-
let
|
7674
|
+
let exprExtras;
|
7672
7675
|
let hasEventHandlers = false;
|
7673
7676
|
let hasDynamicAttributes = false;
|
7674
7677
|
for (let i = attributes.length; i--; ) {
|
@@ -7696,7 +7699,7 @@ var html_script_default = {
|
|
7696
7699
|
} else if (import_compiler38.types.isMarkoSpreadAttribute(attr2)) {
|
7697
7700
|
spreadReferenceNodes = [attr2.value];
|
7698
7701
|
} else {
|
7699
|
-
|
7702
|
+
exprExtras = push(exprExtras, valueExtra);
|
7700
7703
|
}
|
7701
7704
|
}
|
7702
7705
|
const bodyPlaceholderNodes = [];
|
@@ -7724,11 +7727,14 @@ var html_script_default = {
|
|
7724
7727
|
if (spreadReferenceNodes) {
|
7725
7728
|
mergeReferences(tagSection, tag.node, spreadReferenceNodes);
|
7726
7729
|
}
|
7727
|
-
if (
|
7728
|
-
|
7729
|
-
|
7730
|
-
bodyPlaceholderNodes[0]
|
7731
|
-
|
7730
|
+
if (hasBodyPlaceholders) {
|
7731
|
+
exprExtras = push(
|
7732
|
+
exprExtras,
|
7733
|
+
bodyPlaceholderNodes.length === 1 ? bodyPlaceholderNodes[0].extra ??= {} : mergeReferences(
|
7734
|
+
tagSection,
|
7735
|
+
bodyPlaceholderNodes[0],
|
7736
|
+
bodyPlaceholderNodes.slice(1)
|
7737
|
+
)
|
7732
7738
|
);
|
7733
7739
|
}
|
7734
7740
|
if (hasEventHandlers || spreadReferenceNodes) {
|
@@ -7756,7 +7762,7 @@ var html_script_default = {
|
|
7756
7762
|
addBindingSerializeReasonExpr(
|
7757
7763
|
tagSection,
|
7758
7764
|
nodeBinding,
|
7759
|
-
push(
|
7765
|
+
push(exprExtras, tagExtra)
|
7760
7766
|
);
|
7761
7767
|
}
|
7762
7768
|
},
|
@@ -8083,7 +8089,7 @@ var html_style_default = {
|
|
8083
8089
|
const seen = {};
|
8084
8090
|
const { attributes } = tag.node;
|
8085
8091
|
let spreadReferenceNodes;
|
8086
|
-
let
|
8092
|
+
let exprExtras;
|
8087
8093
|
let hasEventHandlers = false;
|
8088
8094
|
let hasDynamicAttributes = false;
|
8089
8095
|
for (let i = attributes.length; i--; ) {
|
@@ -8111,7 +8117,7 @@ var html_style_default = {
|
|
8111
8117
|
} else if (import_compiler39.types.isMarkoSpreadAttribute(attr2)) {
|
8112
8118
|
spreadReferenceNodes = [attr2.value];
|
8113
8119
|
} else {
|
8114
|
-
|
8120
|
+
exprExtras = push(exprExtras, valueExtra);
|
8115
8121
|
}
|
8116
8122
|
}
|
8117
8123
|
const bodyPlaceholderNodes = [];
|
@@ -8139,11 +8145,14 @@ var html_style_default = {
|
|
8139
8145
|
if (spreadReferenceNodes) {
|
8140
8146
|
mergeReferences(tagSection, tag.node, spreadReferenceNodes);
|
8141
8147
|
}
|
8142
|
-
if (
|
8143
|
-
|
8144
|
-
|
8145
|
-
bodyPlaceholderNodes[0]
|
8146
|
-
|
8148
|
+
if (hasBodyPlaceholders) {
|
8149
|
+
exprExtras = push(
|
8150
|
+
exprExtras,
|
8151
|
+
bodyPlaceholderNodes.length === 1 ? bodyPlaceholderNodes[0].extra ??= {} : mergeReferences(
|
8152
|
+
tagSection,
|
8153
|
+
bodyPlaceholderNodes[0],
|
8154
|
+
bodyPlaceholderNodes.slice(1)
|
8155
|
+
)
|
8147
8156
|
);
|
8148
8157
|
}
|
8149
8158
|
if (hasEventHandlers || spreadReferenceNodes) {
|
@@ -8171,7 +8180,7 @@ var html_style_default = {
|
|
8171
8180
|
addBindingSerializeReasonExpr(
|
8172
8181
|
tagSection,
|
8173
8182
|
nodeBinding,
|
8174
|
-
push(
|
8183
|
+
push(exprExtras, tagExtra)
|
8175
8184
|
);
|
8176
8185
|
}
|
8177
8186
|
},
|