marko 6.0.92 → 6.0.93
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/common/errors.d.ts +3 -0
- package/dist/common/types.d.ts +1 -3
- package/dist/debug/dom.js +54 -19
- package/dist/debug/dom.mjs +54 -19
- package/dist/debug/html.js +33 -13
- package/dist/debug/html.mjs +30 -13
- package/dist/dom/scope.d.ts +1 -1
- package/dist/dom/signals.d.ts +1 -0
- package/dist/dom.d.ts +2 -1
- package/dist/dom.js +93 -82
- package/dist/dom.mjs +93 -82
- package/dist/html/writer.d.ts +4 -3
- package/dist/html.d.ts +1 -0
- package/dist/html.js +17 -6
- package/dist/html.mjs +14 -6
- package/dist/translator/core/html-comment.d.ts +0 -2
- package/dist/translator/core/html-script.d.ts +0 -2
- package/dist/translator/core/html-style.d.ts +0 -2
- package/dist/translator/index.js +254 -352
- package/dist/translator/util/references.d.ts +1 -0
- package/dist/translator/util/sections.d.ts +1 -0
- package/dist/translator/util/signals.d.ts +2 -1
- package/dist/translator/util/translate-var.d.ts +2 -0
- package/dist/translator/visitors/program/html.d.ts +1 -0
- package/dist/translator/visitors/tag/native-tag.d.ts +0 -2
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
|
@@ -1639,6 +1639,7 @@ function startSection(path5) {
|
|
|
1639
1639
|
referencedClosures: void 0,
|
|
1640
1640
|
referencedHoists: void 0,
|
|
1641
1641
|
bindings: void 0,
|
|
1642
|
+
domGetterBindings: /* @__PURE__ */ new Map(),
|
|
1642
1643
|
hoisted: void 0,
|
|
1643
1644
|
isHoistThrough: void 0,
|
|
1644
1645
|
serializeReason: void 0,
|
|
@@ -3276,14 +3277,17 @@ var [getHTMLSectionStatements] = createSectionState(
|
|
|
3276
3277
|
"htmlScopeStatements",
|
|
3277
3278
|
() => []
|
|
3278
3279
|
);
|
|
3279
|
-
var [
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3280
|
+
var [getBindingGetterIdMap] = createSectionState(
|
|
3281
|
+
"bindingGetterIdMap",
|
|
3282
|
+
() => /* @__PURE__ */ new Map()
|
|
3283
|
+
);
|
|
3284
|
+
function getBindingGetterIdentifier(binding) {
|
|
3285
|
+
const idsMap = getBindingGetterIdMap(binding.section);
|
|
3286
|
+
let identifier = idsMap.get(binding);
|
|
3283
3287
|
if (!identifier) {
|
|
3284
3288
|
idsMap.set(
|
|
3285
|
-
|
|
3286
|
-
identifier = generateUidIdentifier(`get${
|
|
3289
|
+
binding,
|
|
3290
|
+
identifier = generateUidIdentifier(`get${binding.name}`)
|
|
3287
3291
|
);
|
|
3288
3292
|
}
|
|
3289
3293
|
return identifier;
|
|
@@ -3392,7 +3396,8 @@ function getSignalFn(signal) {
|
|
|
3392
3396
|
const isIntersection = Array.isArray(binding);
|
|
3393
3397
|
const isBinding = binding && !isIntersection;
|
|
3394
3398
|
const isValue = isBinding && binding.section === section;
|
|
3395
|
-
|
|
3399
|
+
const assertsHoists = isValue && binding.hoists.size && !isOptimize();
|
|
3400
|
+
if (isBinding && (signal.renderReferencedBindings || assertsHoists || binding.aliases.size || binding.propertyAliases.size)) {
|
|
3396
3401
|
const valueParam = import_compiler22.types.identifier(binding.name);
|
|
3397
3402
|
if (binding.loc) {
|
|
3398
3403
|
valueParam.loc = binding.loc;
|
|
@@ -3465,6 +3470,13 @@ function getSignalFn(signal) {
|
|
|
3465
3470
|
)
|
|
3466
3471
|
);
|
|
3467
3472
|
}
|
|
3473
|
+
if (assertsHoists) {
|
|
3474
|
+
signal.render.push(
|
|
3475
|
+
import_compiler22.types.expressionStatement(
|
|
3476
|
+
callRuntime("_assert_hoist", import_compiler22.types.identifier(binding.name))
|
|
3477
|
+
)
|
|
3478
|
+
);
|
|
3479
|
+
}
|
|
3468
3480
|
}
|
|
3469
3481
|
for (const value of signal.values) {
|
|
3470
3482
|
if (signalHasStatements(value.signal)) {
|
|
@@ -3740,6 +3752,7 @@ function getRegisterUID(section, name2) {
|
|
|
3740
3752
|
function writeSignals(section) {
|
|
3741
3753
|
const seen = /* @__PURE__ */ new Set();
|
|
3742
3754
|
writeHoists(section);
|
|
3755
|
+
writeDomGetters(section);
|
|
3743
3756
|
for (const signal of getSignals(section).values()) {
|
|
3744
3757
|
writeSignal(signal);
|
|
3745
3758
|
}
|
|
@@ -3813,6 +3826,24 @@ function writeSignals(section) {
|
|
|
3813
3826
|
(0, import_babel_utils15.getProgram)().node.body.push(...signalStatements);
|
|
3814
3827
|
}
|
|
3815
3828
|
}
|
|
3829
|
+
function writeDomGetters(section) {
|
|
3830
|
+
for (const [binding, registerId] of section.domGetterBindings) {
|
|
3831
|
+
(0, import_babel_utils15.getProgram)().node.body.push(
|
|
3832
|
+
import_compiler22.types.variableDeclaration("const", [
|
|
3833
|
+
import_compiler22.types.variableDeclarator(
|
|
3834
|
+
getBindingGetterIdentifier(binding),
|
|
3835
|
+
callRuntime(
|
|
3836
|
+
"_el",
|
|
3837
|
+
import_compiler22.types.stringLiteral(registerId),
|
|
3838
|
+
import_compiler22.types.stringLiteral(
|
|
3839
|
+
getAccessorPrefix().Getter + getScopeAccessorLiteral(binding).value
|
|
3840
|
+
)
|
|
3841
|
+
)
|
|
3842
|
+
)
|
|
3843
|
+
])
|
|
3844
|
+
);
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3816
3847
|
function writeHoists(section) {
|
|
3817
3848
|
forEach(section.hoisted, (binding) => {
|
|
3818
3849
|
for (const hoistedBinding of binding.hoists.values()) {
|
|
@@ -3829,7 +3860,7 @@ function writeHoists(section) {
|
|
|
3829
3860
|
}
|
|
3830
3861
|
currentSection = parentSection;
|
|
3831
3862
|
}
|
|
3832
|
-
const hoistIdentifier =
|
|
3863
|
+
const hoistIdentifier = getBindingGetterIdentifier(hoistedBinding);
|
|
3833
3864
|
(0, import_babel_utils15.getProgram)().node.body.push(
|
|
3834
3865
|
import_compiler22.types.variableDeclaration("const", [
|
|
3835
3866
|
import_compiler22.types.variableDeclarator(
|
|
@@ -3967,66 +3998,6 @@ function writeHTMLResumeStatements(path5) {
|
|
|
3967
3998
|
}
|
|
3968
3999
|
}
|
|
3969
4000
|
});
|
|
3970
|
-
const sectionDynamicSubscribers = /* @__PURE__ */ new Set();
|
|
3971
|
-
forEach(section.hoisted, (binding) => {
|
|
3972
|
-
for (const hoistedBinding of binding.hoists.values()) {
|
|
3973
|
-
if (hoistedBinding.downstreamExpressions.size) {
|
|
3974
|
-
getHTMLSectionStatements(hoistedBinding.section).push(
|
|
3975
|
-
import_compiler22.types.variableDeclaration("const", [
|
|
3976
|
-
import_compiler22.types.variableDeclarator(
|
|
3977
|
-
import_compiler22.types.identifier(hoistedBinding.name),
|
|
3978
|
-
callRuntime(
|
|
3979
|
-
"_hoist",
|
|
3980
|
-
getScopeIdIdentifier(hoistedBinding.section),
|
|
3981
|
-
import_compiler22.types.stringLiteral(
|
|
3982
|
-
getResumeRegisterId(
|
|
3983
|
-
hoistedBinding.section,
|
|
3984
|
-
hoistedBinding,
|
|
3985
|
-
"hoist"
|
|
3986
|
-
)
|
|
3987
|
-
)
|
|
3988
|
-
)
|
|
3989
|
-
)
|
|
3990
|
-
])
|
|
3991
|
-
);
|
|
3992
|
-
}
|
|
3993
|
-
let currentSection = section;
|
|
3994
|
-
while (currentSection && currentSection !== hoistedBinding.section) {
|
|
3995
|
-
const parentSection = currentSection.parent;
|
|
3996
|
-
if (!currentSection.sectionAccessor && !sectionDynamicSubscribers.has(currentSection)) {
|
|
3997
|
-
const subscribersIdentifier = generateUidIdentifier(
|
|
3998
|
-
`${currentSection.name}__subscribers`
|
|
3999
|
-
);
|
|
4000
|
-
sectionDynamicSubscribers.add(currentSection);
|
|
4001
|
-
getHTMLSectionStatements(parentSection).push(
|
|
4002
|
-
import_compiler22.types.variableDeclaration("const", [
|
|
4003
|
-
import_compiler22.types.variableDeclarator(
|
|
4004
|
-
subscribersIdentifier,
|
|
4005
|
-
import_compiler22.types.newExpression(import_compiler22.types.identifier("Set"), [])
|
|
4006
|
-
)
|
|
4007
|
-
])
|
|
4008
|
-
);
|
|
4009
|
-
addWriteScopeBuilder(
|
|
4010
|
-
currentSection,
|
|
4011
|
-
(expr) => callRuntime("_subscribe", subscribersIdentifier, expr)
|
|
4012
|
-
);
|
|
4013
|
-
setSerializedValue(
|
|
4014
|
-
parentSection,
|
|
4015
|
-
getSectionInstancesAccessor(currentSection),
|
|
4016
|
-
subscribersIdentifier
|
|
4017
|
-
);
|
|
4018
|
-
}
|
|
4019
|
-
currentSection = parentSection;
|
|
4020
|
-
}
|
|
4021
|
-
}
|
|
4022
|
-
if (binding.hoists.size && binding.type !== 0 /* dom */) {
|
|
4023
|
-
setBindingSerializedValue(
|
|
4024
|
-
section,
|
|
4025
|
-
binding,
|
|
4026
|
-
getDeclaredBindingExpression(binding)
|
|
4027
|
-
);
|
|
4028
|
-
}
|
|
4029
|
-
});
|
|
4030
4001
|
for (let i = allSignals.length; i--; ) {
|
|
4031
4002
|
if (allSignals[i].effect.length) {
|
|
4032
4003
|
const signalRefs = allSignals[i].referencedBindings;
|
|
@@ -4149,6 +4120,17 @@ function writeHTMLResumeStatements(path5) {
|
|
|
4149
4120
|
...additionalStatements
|
|
4150
4121
|
);
|
|
4151
4122
|
}
|
|
4123
|
+
if (debug) {
|
|
4124
|
+
forEach(section.bindings, (binding) => {
|
|
4125
|
+
if (binding.hoists.size && binding.type !== 0 /* dom */) {
|
|
4126
|
+
body.push(
|
|
4127
|
+
import_compiler22.types.expressionStatement(
|
|
4128
|
+
callRuntime("_assert_hoist", import_compiler22.types.identifier(binding.name))
|
|
4129
|
+
)
|
|
4130
|
+
);
|
|
4131
|
+
}
|
|
4132
|
+
});
|
|
4133
|
+
}
|
|
4152
4134
|
const returnIdentifier = getSectionReturnValueIdentifier(section);
|
|
4153
4135
|
if (returnIdentifier !== void 0) {
|
|
4154
4136
|
body.push(import_compiler22.types.returnStatement(returnIdentifier));
|
|
@@ -4170,6 +4152,15 @@ function replaceBindingReadNode(node) {
|
|
|
4170
4152
|
case "OptionalMemberExpression": {
|
|
4171
4153
|
return getReadReplacement(node);
|
|
4172
4154
|
}
|
|
4155
|
+
case "CallExpression": {
|
|
4156
|
+
const { extra } = node.callee;
|
|
4157
|
+
const binding = extra?.read?.binding;
|
|
4158
|
+
if (binding?.type === 0 /* dom */) {
|
|
4159
|
+
const replacement = createScopeReadExpression(extra.section, binding);
|
|
4160
|
+
return isOptimize() ? replacement : callRuntime("_el_read", replacement);
|
|
4161
|
+
}
|
|
4162
|
+
break;
|
|
4163
|
+
}
|
|
4173
4164
|
}
|
|
4174
4165
|
}
|
|
4175
4166
|
var updateExpressions = /* @__PURE__ */ new WeakSet();
|
|
@@ -4509,6 +4500,70 @@ function getTemplateContentName() {
|
|
|
4509
4500
|
}
|
|
4510
4501
|
var html_default = {
|
|
4511
4502
|
translate: {
|
|
4503
|
+
enter() {
|
|
4504
|
+
forEachSection((section) => {
|
|
4505
|
+
const sectionDynamicSubscribers = /* @__PURE__ */ new Set();
|
|
4506
|
+
forEach(section.hoisted, (binding) => {
|
|
4507
|
+
for (const hoistedBinding of binding.hoists.values()) {
|
|
4508
|
+
if (hoistedBinding.downstreamExpressions.size) {
|
|
4509
|
+
getHTMLSectionStatements(hoistedBinding.section).push(
|
|
4510
|
+
import_compiler24.types.variableDeclaration("const", [
|
|
4511
|
+
import_compiler24.types.variableDeclarator(
|
|
4512
|
+
import_compiler24.types.identifier(hoistedBinding.name),
|
|
4513
|
+
callRuntime(
|
|
4514
|
+
"_hoist",
|
|
4515
|
+
getScopeIdIdentifier(hoistedBinding.section),
|
|
4516
|
+
import_compiler24.types.stringLiteral(
|
|
4517
|
+
getResumeRegisterId(
|
|
4518
|
+
hoistedBinding.section,
|
|
4519
|
+
hoistedBinding,
|
|
4520
|
+
"hoist"
|
|
4521
|
+
)
|
|
4522
|
+
)
|
|
4523
|
+
)
|
|
4524
|
+
)
|
|
4525
|
+
])
|
|
4526
|
+
);
|
|
4527
|
+
}
|
|
4528
|
+
let currentSection = section;
|
|
4529
|
+
while (currentSection && currentSection !== hoistedBinding.section) {
|
|
4530
|
+
const parentSection = currentSection.parent;
|
|
4531
|
+
if (!currentSection.sectionAccessor && !sectionDynamicSubscribers.has(currentSection)) {
|
|
4532
|
+
const subscribersIdentifier = generateUidIdentifier(
|
|
4533
|
+
`${currentSection.name}__subscribers`
|
|
4534
|
+
);
|
|
4535
|
+
sectionDynamicSubscribers.add(currentSection);
|
|
4536
|
+
getHTMLSectionStatements(parentSection).push(
|
|
4537
|
+
import_compiler24.types.variableDeclaration("const", [
|
|
4538
|
+
import_compiler24.types.variableDeclarator(
|
|
4539
|
+
subscribersIdentifier,
|
|
4540
|
+
import_compiler24.types.newExpression(import_compiler24.types.identifier("Set"), [])
|
|
4541
|
+
)
|
|
4542
|
+
])
|
|
4543
|
+
);
|
|
4544
|
+
addWriteScopeBuilder(
|
|
4545
|
+
currentSection,
|
|
4546
|
+
(expr) => callRuntime("_subscribe", subscribersIdentifier, expr)
|
|
4547
|
+
);
|
|
4548
|
+
setSerializedValue(
|
|
4549
|
+
parentSection,
|
|
4550
|
+
getSectionInstancesAccessor(currentSection),
|
|
4551
|
+
subscribersIdentifier
|
|
4552
|
+
);
|
|
4553
|
+
}
|
|
4554
|
+
currentSection = parentSection;
|
|
4555
|
+
}
|
|
4556
|
+
}
|
|
4557
|
+
if (binding.hoists.size && binding.type !== 0 /* dom */) {
|
|
4558
|
+
setBindingSerializedValue(
|
|
4559
|
+
section,
|
|
4560
|
+
binding,
|
|
4561
|
+
getDeclaredBindingExpression(binding)
|
|
4562
|
+
);
|
|
4563
|
+
}
|
|
4564
|
+
});
|
|
4565
|
+
});
|
|
4566
|
+
},
|
|
4512
4567
|
exit(program) {
|
|
4513
4568
|
flushInto(program);
|
|
4514
4569
|
writeHTMLResumeStatements(program);
|
|
@@ -4583,6 +4638,24 @@ function replaceBindingReadNode2(node) {
|
|
|
4583
4638
|
if (extra && !(extra.read && !extra.read.binding.declared || extra.binding && !extra.binding.declared)) {
|
|
4584
4639
|
return getReadReplacement(node);
|
|
4585
4640
|
}
|
|
4641
|
+
break;
|
|
4642
|
+
}
|
|
4643
|
+
case "CallExpression": {
|
|
4644
|
+
const binding = node.callee.extra?.read?.binding;
|
|
4645
|
+
if (binding && (binding.type === 6 /* hoist */ || binding.type === 0 /* dom */)) {
|
|
4646
|
+
return import_compiler24.types.callExpression(
|
|
4647
|
+
import_compiler24.types.arrowFunctionExpression(
|
|
4648
|
+
[import_compiler24.types.cloneNode(node.callee)],
|
|
4649
|
+
node
|
|
4650
|
+
),
|
|
4651
|
+
[
|
|
4652
|
+
importRuntime(
|
|
4653
|
+
binding.type === 0 /* dom */ ? "_el_read_error" : "_hoist_read_error"
|
|
4654
|
+
)
|
|
4655
|
+
]
|
|
4656
|
+
);
|
|
4657
|
+
}
|
|
4658
|
+
break;
|
|
4586
4659
|
}
|
|
4587
4660
|
}
|
|
4588
4661
|
}
|
|
@@ -5013,6 +5086,9 @@ var program_default = {
|
|
|
5013
5086
|
program.skip();
|
|
5014
5087
|
return;
|
|
5015
5088
|
}
|
|
5089
|
+
if (isOutputHTML()) {
|
|
5090
|
+
html_default.translate.enter();
|
|
5091
|
+
}
|
|
5016
5092
|
},
|
|
5017
5093
|
exit(program) {
|
|
5018
5094
|
if (isOutputHTML()) {
|
|
@@ -5258,6 +5334,27 @@ function translateVar(tag, initialValue, kind = "const") {
|
|
|
5258
5334
|
import_compiler29.types.variableDeclaration(kind, [import_compiler29.types.variableDeclarator(tagVar, initialValue)])
|
|
5259
5335
|
);
|
|
5260
5336
|
}
|
|
5337
|
+
function translateDomVar(tag, binding) {
|
|
5338
|
+
if (binding && tag.node.var) {
|
|
5339
|
+
const tagSection = getSection(tag);
|
|
5340
|
+
const registerId = tagSection.domGetterBindings.get(binding);
|
|
5341
|
+
if (registerId) {
|
|
5342
|
+
tag.parentPath.unshiftContainer(
|
|
5343
|
+
"body",
|
|
5344
|
+
import_compiler29.types.variableDeclaration("const", [
|
|
5345
|
+
import_compiler29.types.variableDeclarator(
|
|
5346
|
+
tag.node.var,
|
|
5347
|
+
callRuntime(
|
|
5348
|
+
"_el",
|
|
5349
|
+
getScopeIdIdentifier(tagSection),
|
|
5350
|
+
import_compiler29.types.stringLiteral(registerId)
|
|
5351
|
+
)
|
|
5352
|
+
)
|
|
5353
|
+
])
|
|
5354
|
+
);
|
|
5355
|
+
}
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5261
5358
|
function getDestructurePattern(id) {
|
|
5262
5359
|
let cur = id;
|
|
5263
5360
|
while (cur) {
|
|
@@ -5271,7 +5368,6 @@ function getDestructurePattern(id) {
|
|
|
5271
5368
|
// src/translator/visitors/tag/native-tag.ts
|
|
5272
5369
|
var kNativeTagBinding = Symbol("native tag binding");
|
|
5273
5370
|
var kSkipEndTag = Symbol("skip native tag mark");
|
|
5274
|
-
var kGetterId = Symbol("node getter id");
|
|
5275
5371
|
var kTagContentAttr = Symbol("tag could have dynamic content attribute");
|
|
5276
5372
|
var htmlSelectArgs = /* @__PURE__ */ new WeakMap();
|
|
5277
5373
|
var native_tag_default = {
|
|
@@ -5360,26 +5456,7 @@ var native_tag_default = {
|
|
|
5360
5456
|
!!(node.var || hasEventHandlers),
|
|
5361
5457
|
nodeBinding
|
|
5362
5458
|
);
|
|
5363
|
-
|
|
5364
|
-
for (const ref of tag.scope.getBinding(node.var.name).referencePaths) {
|
|
5365
|
-
const refSection = getOrCreateSection(ref);
|
|
5366
|
-
setReferencesScope(ref);
|
|
5367
|
-
if (isSameOrChildSection(tagSection, refSection)) {
|
|
5368
|
-
addOwnerSerializeReason(refSection, tagSection, true);
|
|
5369
|
-
if (!tagExtra[kGetterId] && !isInvokedFunction(ref)) {
|
|
5370
|
-
tagExtra[kGetterId] = getRegisterUID(
|
|
5371
|
-
tagSection,
|
|
5372
|
-
nodeBinding.name
|
|
5373
|
-
);
|
|
5374
|
-
}
|
|
5375
|
-
} else {
|
|
5376
|
-
trackHoistedReference(
|
|
5377
|
-
ref,
|
|
5378
|
-
nodeBinding
|
|
5379
|
-
);
|
|
5380
|
-
}
|
|
5381
|
-
}
|
|
5382
|
-
}
|
|
5459
|
+
trackDomVarReferences(tag, nodeBinding);
|
|
5383
5460
|
addSerializeExpr(
|
|
5384
5461
|
tagSection,
|
|
5385
5462
|
push(attrExprExtras, tagExtra),
|
|
@@ -5400,17 +5477,7 @@ var native_tag_default = {
|
|
|
5400
5477
|
if (tagExtra.tagNameNullable) {
|
|
5401
5478
|
flushBefore(tag);
|
|
5402
5479
|
}
|
|
5403
|
-
|
|
5404
|
-
const getterId = tagExtra[kGetterId];
|
|
5405
|
-
translateVar(
|
|
5406
|
-
tag,
|
|
5407
|
-
callRuntime(
|
|
5408
|
-
"_el",
|
|
5409
|
-
getterId && getScopeIdIdentifier(tagSection),
|
|
5410
|
-
getterId && import_compiler30.types.stringLiteral(getterId)
|
|
5411
|
-
)
|
|
5412
|
-
);
|
|
5413
|
-
}
|
|
5480
|
+
translateDomVar(tag, nodeBinding);
|
|
5414
5481
|
const visitAccessor = nodeBinding && getScopeAccessorLiteral(nodeBinding);
|
|
5415
5482
|
write`<${tag.node.name}`;
|
|
5416
5483
|
const usedAttrs = getUsedAttrs(tagName, tag.node);
|
|
@@ -5662,59 +5729,6 @@ var native_tag_default = {
|
|
|
5662
5729
|
const tagDef = (0, import_babel_utils20.getTagDef)(tag);
|
|
5663
5730
|
const write = writeTo(tag);
|
|
5664
5731
|
const tagSection = getSection(tag);
|
|
5665
|
-
if (tag.node.var) {
|
|
5666
|
-
const varName = tag.node.var.name;
|
|
5667
|
-
const varBinding = tag.scope.getBinding(varName);
|
|
5668
|
-
const getterId = tagExtra[kGetterId];
|
|
5669
|
-
let getterFnIdentifier;
|
|
5670
|
-
if (getterId) {
|
|
5671
|
-
getterFnIdentifier = generateUidIdentifier(`get_${varName}`);
|
|
5672
|
-
(0, import_babel_utils20.getProgram)().node.body.push(
|
|
5673
|
-
import_compiler30.types.variableDeclaration("const", [
|
|
5674
|
-
import_compiler30.types.variableDeclarator(
|
|
5675
|
-
getterFnIdentifier,
|
|
5676
|
-
callRuntime(
|
|
5677
|
-
"_el",
|
|
5678
|
-
import_compiler30.types.stringLiteral(getterId),
|
|
5679
|
-
import_compiler30.types.stringLiteral(
|
|
5680
|
-
getAccessorPrefix().Getter + getScopeAccessorLiteral(nodeBinding).value
|
|
5681
|
-
)
|
|
5682
|
-
)
|
|
5683
|
-
)
|
|
5684
|
-
])
|
|
5685
|
-
);
|
|
5686
|
-
}
|
|
5687
|
-
for (const reference of varBinding.referencePaths) {
|
|
5688
|
-
const referenceSection = getSection(reference);
|
|
5689
|
-
if (isSameOrChildSection(tagSection, referenceSection)) {
|
|
5690
|
-
if (isInvokedFunction(reference)) {
|
|
5691
|
-
reference.parentPath.replaceWith(
|
|
5692
|
-
import_compiler30.types.expressionStatement(
|
|
5693
|
-
createScopeReadExpression(referenceSection, nodeBinding)
|
|
5694
|
-
)
|
|
5695
|
-
);
|
|
5696
|
-
} else if (getterFnIdentifier) {
|
|
5697
|
-
reference.replaceWith(
|
|
5698
|
-
import_compiler30.types.callExpression(getterFnIdentifier, [
|
|
5699
|
-
getScopeExpression(referenceSection, getSection(tag))
|
|
5700
|
-
])
|
|
5701
|
-
);
|
|
5702
|
-
} else {
|
|
5703
|
-
reference.replaceWith(
|
|
5704
|
-
import_compiler30.types.expressionStatement(
|
|
5705
|
-
import_compiler30.types.memberExpression(
|
|
5706
|
-
getScopeExpression(tagSection, referenceSection),
|
|
5707
|
-
import_compiler30.types.stringLiteral(
|
|
5708
|
-
getAccessorPrefix().Getter + getScopeAccessorLiteral(nodeBinding).value
|
|
5709
|
-
),
|
|
5710
|
-
true
|
|
5711
|
-
)
|
|
5712
|
-
)
|
|
5713
|
-
);
|
|
5714
|
-
}
|
|
5715
|
-
}
|
|
5716
|
-
}
|
|
5717
|
-
}
|
|
5718
5732
|
const visitAccessor = nodeBinding && getScopeAccessorLiteral(nodeBinding);
|
|
5719
5733
|
if (visitAccessor) {
|
|
5720
5734
|
visit(tag, 32 /* Get */);
|
|
@@ -7779,6 +7793,42 @@ function createBinding(name2, type, section, upstreamAlias, property, excludePro
|
|
|
7779
7793
|
getBindings().add(binding);
|
|
7780
7794
|
return binding;
|
|
7781
7795
|
}
|
|
7796
|
+
function trackDomVarReferences(tag, binding) {
|
|
7797
|
+
const tagVar = tag.node.var;
|
|
7798
|
+
if (!tagVar) {
|
|
7799
|
+
return;
|
|
7800
|
+
}
|
|
7801
|
+
if (!import_compiler35.types.isIdentifier(tagVar)) {
|
|
7802
|
+
throw tag.get("var").buildCodeFrameError(
|
|
7803
|
+
"Tag variables on native elements cannot be destructured."
|
|
7804
|
+
);
|
|
7805
|
+
}
|
|
7806
|
+
const babelBinding = tag.scope.getBinding(tagVar.name);
|
|
7807
|
+
const section = getOrCreateSection(tag);
|
|
7808
|
+
if (babelBinding.constantViolations.length) {
|
|
7809
|
+
throw babelBinding.constantViolations[0].buildCodeFrameError(
|
|
7810
|
+
"Tag variables on native elements cannot be assigned to."
|
|
7811
|
+
);
|
|
7812
|
+
}
|
|
7813
|
+
let registerId;
|
|
7814
|
+
for (const ref of babelBinding.referencePaths) {
|
|
7815
|
+
const refSection = getOrCreateSection(ref);
|
|
7816
|
+
setReferencesScope(ref);
|
|
7817
|
+
if (isSameOrChildSection(binding.section, refSection)) {
|
|
7818
|
+
(ref.node.extra ??= {}).read = createRead(binding, void 0);
|
|
7819
|
+
if (!isInvokedFunction(ref)) {
|
|
7820
|
+
section.domGetterBindings.set(
|
|
7821
|
+
binding,
|
|
7822
|
+
registerId ??= getRegisterUID(section, binding.name)
|
|
7823
|
+
);
|
|
7824
|
+
}
|
|
7825
|
+
addOwnerSerializeReason(refSection, section, true);
|
|
7826
|
+
} else {
|
|
7827
|
+
trackHoistedReference(ref, binding);
|
|
7828
|
+
}
|
|
7829
|
+
}
|
|
7830
|
+
return binding;
|
|
7831
|
+
}
|
|
7782
7832
|
function trackVarReferences(tag, type, upstreamAlias) {
|
|
7783
7833
|
const tagVar = tag.node.var;
|
|
7784
7834
|
if (tagVar) {
|
|
@@ -7898,20 +7948,35 @@ function trackHoistedReference(referencePath, binding) {
|
|
|
7898
7948
|
hoistedBinding
|
|
7899
7949
|
);
|
|
7900
7950
|
}
|
|
7951
|
+
function isReferenceHoisted(bindingPath, reference) {
|
|
7952
|
+
const tag = bindingPath.isMarkoTag() ? bindingPath : getMarkoRoot(bindingPath)?.parentPath;
|
|
7953
|
+
if (!tag?.isMarkoTag()) {
|
|
7954
|
+
return false;
|
|
7955
|
+
}
|
|
7956
|
+
const body = tag.parentPath;
|
|
7957
|
+
let cur = reference;
|
|
7958
|
+
while (cur) {
|
|
7959
|
+
if (cur.parentPath === body) {
|
|
7960
|
+
return +tag.key > +cur.key;
|
|
7961
|
+
}
|
|
7962
|
+
cur = cur.parentPath;
|
|
7963
|
+
}
|
|
7964
|
+
return true;
|
|
7965
|
+
}
|
|
7901
7966
|
function trackReferencesForBinding(babelBinding, binding) {
|
|
7902
7967
|
const { referencePaths, constantViolations } = babelBinding;
|
|
7903
|
-
for (const
|
|
7904
|
-
const
|
|
7905
|
-
if (
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
trackReference(referencePath, binding);
|
|
7910
|
-
} else {
|
|
7911
|
-
trackHoistedReference(referencePath, binding);
|
|
7968
|
+
for (const ref of referencePaths) {
|
|
7969
|
+
const refSection = getOrCreateSection(ref);
|
|
7970
|
+
if (isReferenceHoisted(babelBinding.path, ref)) {
|
|
7971
|
+
trackHoistedReference(ref, binding);
|
|
7972
|
+
} else if (binding.type !== 4 /* local */ || refSection !== binding.section) {
|
|
7973
|
+
trackReference(ref, binding);
|
|
7912
7974
|
}
|
|
7913
7975
|
}
|
|
7914
7976
|
for (const ref of constantViolations) {
|
|
7977
|
+
if (isReferenceHoisted(babelBinding.path, ref)) {
|
|
7978
|
+
throw ref.buildCodeFrameError("Cannot assign to hoisted tag variable.");
|
|
7979
|
+
}
|
|
7915
7980
|
if (ref.isUpdateExpression()) {
|
|
7916
7981
|
trackAssignment(ref.get("argument"), binding);
|
|
7917
7982
|
} else if (ref.isAssignmentExpression()) {
|
|
@@ -8677,10 +8742,23 @@ function getReadReplacement(node) {
|
|
|
8677
8742
|
}
|
|
8678
8743
|
if (binding) {
|
|
8679
8744
|
if (node.type === "Identifier") {
|
|
8680
|
-
if (binding.type ===
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8745
|
+
if (binding.type === 0 /* dom */) {
|
|
8746
|
+
if (binding.section.domGetterBindings.has(binding) && isOutputDOM()) {
|
|
8747
|
+
replacement = import_compiler35.types.callExpression(getBindingGetterIdentifier(binding), [
|
|
8748
|
+
getScopeExpression(node.extra.section, binding.section)
|
|
8749
|
+
]);
|
|
8750
|
+
}
|
|
8751
|
+
} else if (binding.type === 6 /* hoist */) {
|
|
8752
|
+
if (node.extra?.[kIsInvoked]) {
|
|
8753
|
+
if (isOutputDOM()) {
|
|
8754
|
+
replacement = import_compiler35.types.callExpression(
|
|
8755
|
+
getBindingGetterIdentifier(binding),
|
|
8756
|
+
[getScopeExpression(node.extra.section, binding.section)]
|
|
8757
|
+
);
|
|
8758
|
+
}
|
|
8759
|
+
} else {
|
|
8760
|
+
replacement = import_compiler35.types.identifier(binding.name);
|
|
8761
|
+
}
|
|
8684
8762
|
} else if (binding.name !== node.name) {
|
|
8685
8763
|
node.name = binding.name;
|
|
8686
8764
|
}
|
|
@@ -9375,7 +9453,6 @@ function templateElement(value, tail) {
|
|
|
9375
9453
|
|
|
9376
9454
|
// src/translator/core/html-comment.ts
|
|
9377
9455
|
var kNodeBinding = Symbol("comment tag binding");
|
|
9378
|
-
var kGetterId2 = Symbol("node getter id");
|
|
9379
9456
|
var html_comment_default = {
|
|
9380
9457
|
analyze(tag) {
|
|
9381
9458
|
(0, import_babel_utils33.assertNoArgs)(tag);
|
|
@@ -9383,7 +9460,6 @@ var html_comment_default = {
|
|
|
9383
9460
|
(0, import_babel_utils33.assertNoAttributes)(tag);
|
|
9384
9461
|
const tagVar = tag.node.var;
|
|
9385
9462
|
let needsBinding = false;
|
|
9386
|
-
let needsGetter = false;
|
|
9387
9463
|
if (tagVar) {
|
|
9388
9464
|
if (!import_compiler43.types.isIdentifier(tagVar)) {
|
|
9389
9465
|
throw tag.get("var").buildCodeFrameError(
|
|
@@ -9391,12 +9467,6 @@ var html_comment_default = {
|
|
|
9391
9467
|
);
|
|
9392
9468
|
}
|
|
9393
9469
|
needsBinding = true;
|
|
9394
|
-
for (const ref of tag.scope.getBinding(tagVar.name).referencePaths) {
|
|
9395
|
-
if (!isInvokedFunction(ref)) {
|
|
9396
|
-
needsGetter = true;
|
|
9397
|
-
break;
|
|
9398
|
-
}
|
|
9399
|
-
}
|
|
9400
9470
|
}
|
|
9401
9471
|
const referenceNodes = [];
|
|
9402
9472
|
for (const child of tag.get("body").get("body")) {
|
|
@@ -9417,9 +9487,7 @@ var html_comment_default = {
|
|
|
9417
9487
|
0 /* dom */,
|
|
9418
9488
|
tagSection
|
|
9419
9489
|
);
|
|
9420
|
-
|
|
9421
|
-
tagExtra[kGetterId2] = getRegisterUID(tagSection, "comment");
|
|
9422
|
-
}
|
|
9490
|
+
trackDomVarReferences(tag, nodeBinding);
|
|
9423
9491
|
addSerializeExpr(tagSection, !!tagVar || tagExtra, nodeBinding);
|
|
9424
9492
|
}
|
|
9425
9493
|
tag.skip();
|
|
@@ -9428,54 +9496,8 @@ var html_comment_default = {
|
|
|
9428
9496
|
enter(tag) {
|
|
9429
9497
|
const tagExtra = tag.node.extra;
|
|
9430
9498
|
const nodeBinding = tagExtra[kNodeBinding];
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
const getterId = tagExtra[kGetterId2];
|
|
9434
|
-
if (isOutputHTML()) {
|
|
9435
|
-
translateVar(
|
|
9436
|
-
tag,
|
|
9437
|
-
callRuntime(
|
|
9438
|
-
"_el",
|
|
9439
|
-
getterId && getScopeIdIdentifier(getSection(tag)),
|
|
9440
|
-
getterId && import_compiler43.types.stringLiteral(getterId)
|
|
9441
|
-
)
|
|
9442
|
-
);
|
|
9443
|
-
} else {
|
|
9444
|
-
const varName = tag.node.var.name;
|
|
9445
|
-
const references = tag.scope.getBinding(varName).referencePaths;
|
|
9446
|
-
let getterFnIdentifier;
|
|
9447
|
-
if (getterId) {
|
|
9448
|
-
getterFnIdentifier = generateUidIdentifier(`get_${varName}`);
|
|
9449
|
-
(0, import_babel_utils33.getProgram)().node.body.push(
|
|
9450
|
-
import_compiler43.types.variableDeclaration("const", [
|
|
9451
|
-
import_compiler43.types.variableDeclarator(
|
|
9452
|
-
getterFnIdentifier,
|
|
9453
|
-
callRuntime(
|
|
9454
|
-
"_el",
|
|
9455
|
-
import_compiler43.types.stringLiteral(getterId),
|
|
9456
|
-
getScopeAccessorLiteral(nodeBinding)
|
|
9457
|
-
)
|
|
9458
|
-
)
|
|
9459
|
-
])
|
|
9460
|
-
);
|
|
9461
|
-
}
|
|
9462
|
-
for (const reference of references) {
|
|
9463
|
-
const referenceSection = getSection(reference);
|
|
9464
|
-
if (isInvokedFunction(reference)) {
|
|
9465
|
-
reference.parentPath.replaceWith(
|
|
9466
|
-
import_compiler43.types.expressionStatement(
|
|
9467
|
-
createScopeReadExpression(referenceSection, nodeBinding)
|
|
9468
|
-
)
|
|
9469
|
-
);
|
|
9470
|
-
} else if (getterFnIdentifier) {
|
|
9471
|
-
reference.replaceWith(
|
|
9472
|
-
import_compiler43.types.callExpression(getterFnIdentifier, [
|
|
9473
|
-
getScopeExpression(referenceSection, getSection(tag))
|
|
9474
|
-
])
|
|
9475
|
-
);
|
|
9476
|
-
}
|
|
9477
|
-
}
|
|
9478
|
-
}
|
|
9499
|
+
if (isOutputHTML()) {
|
|
9500
|
+
translateDomVar(tag, nodeBinding);
|
|
9479
9501
|
}
|
|
9480
9502
|
if (nodeBinding) {
|
|
9481
9503
|
visit(tag, 32 /* Get */);
|
|
@@ -9547,7 +9569,6 @@ var html_comment_default = {
|
|
|
9547
9569
|
var import_compiler44 = require("@marko/compiler");
|
|
9548
9570
|
var import_babel_utils34 = require("@marko/compiler/babel-utils");
|
|
9549
9571
|
var kNodeBinding2 = Symbol("script tag node binding");
|
|
9550
|
-
var kGetterId3 = Symbol("node getter id");
|
|
9551
9572
|
var html_script_default = {
|
|
9552
9573
|
analyze(tag) {
|
|
9553
9574
|
(0, import_babel_utils34.assertNoArgs)(tag);
|
|
@@ -9629,25 +9650,12 @@ var html_script_default = {
|
|
|
9629
9650
|
)
|
|
9630
9651
|
);
|
|
9631
9652
|
}
|
|
9653
|
+
trackDomVarReferences(tag, nodeBinding);
|
|
9632
9654
|
addSerializeExpr(
|
|
9633
9655
|
tagSection,
|
|
9634
9656
|
!!(node.var || hasEventHandlers),
|
|
9635
9657
|
nodeBinding
|
|
9636
9658
|
);
|
|
9637
|
-
if (node.var) {
|
|
9638
|
-
for (const ref of tag.scope.getBinding(node.var.name).referencePaths) {
|
|
9639
|
-
const refSection = getOrCreateSection(ref);
|
|
9640
|
-
setReferencesScope(ref);
|
|
9641
|
-
if (isSameOrChildSection(tagSection, refSection)) {
|
|
9642
|
-
addOwnerSerializeReason(refSection, tagSection, true);
|
|
9643
|
-
if (!tagExtra[kGetterId3] && !isInvokedFunction(ref)) {
|
|
9644
|
-
tagExtra[kGetterId3] = getRegisterUID(tagSection, "#script");
|
|
9645
|
-
}
|
|
9646
|
-
} else {
|
|
9647
|
-
trackHoistedReference(ref, nodeBinding);
|
|
9648
|
-
}
|
|
9649
|
-
}
|
|
9650
|
-
}
|
|
9651
9659
|
addSerializeExpr(tagSection, push(exprExtras, tagExtra), nodeBinding);
|
|
9652
9660
|
}
|
|
9653
9661
|
},
|
|
@@ -9658,54 +9666,8 @@ var html_script_default = {
|
|
|
9658
9666
|
const isHTML = isOutputHTML();
|
|
9659
9667
|
const write = writeTo(tag);
|
|
9660
9668
|
const tagSection = getSection(tag);
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
const getterId = tagExtra[kGetterId3];
|
|
9664
|
-
if (isHTML) {
|
|
9665
|
-
translateVar(
|
|
9666
|
-
tag,
|
|
9667
|
-
callRuntime(
|
|
9668
|
-
"_el",
|
|
9669
|
-
getterId && getScopeIdIdentifier(tagSection),
|
|
9670
|
-
getterId && import_compiler44.types.stringLiteral(getterId)
|
|
9671
|
-
)
|
|
9672
|
-
);
|
|
9673
|
-
} else {
|
|
9674
|
-
const varName = tag.node.var.name;
|
|
9675
|
-
const references = tag.scope.getBinding(varName).referencePaths;
|
|
9676
|
-
let getterFnIdentifier;
|
|
9677
|
-
if (getterId) {
|
|
9678
|
-
getterFnIdentifier = generateUidIdentifier(`get_${varName}`);
|
|
9679
|
-
(0, import_babel_utils34.getProgram)().node.body.push(
|
|
9680
|
-
import_compiler44.types.variableDeclaration("const", [
|
|
9681
|
-
import_compiler44.types.variableDeclarator(
|
|
9682
|
-
getterFnIdentifier,
|
|
9683
|
-
callRuntime(
|
|
9684
|
-
"_el",
|
|
9685
|
-
import_compiler44.types.stringLiteral(getterId),
|
|
9686
|
-
getScopeAccessorLiteral(nodeBinding)
|
|
9687
|
-
)
|
|
9688
|
-
)
|
|
9689
|
-
])
|
|
9690
|
-
);
|
|
9691
|
-
}
|
|
9692
|
-
for (const reference of references) {
|
|
9693
|
-
const referenceSection = getSection(reference);
|
|
9694
|
-
if (isInvokedFunction(reference)) {
|
|
9695
|
-
reference.parentPath.replaceWith(
|
|
9696
|
-
import_compiler44.types.expressionStatement(
|
|
9697
|
-
createScopeReadExpression(referenceSection, nodeBinding)
|
|
9698
|
-
)
|
|
9699
|
-
);
|
|
9700
|
-
} else if (getterFnIdentifier) {
|
|
9701
|
-
reference.replaceWith(
|
|
9702
|
-
import_compiler44.types.callExpression(getterFnIdentifier, [
|
|
9703
|
-
getScopeExpression(referenceSection, getSection(tag))
|
|
9704
|
-
])
|
|
9705
|
-
);
|
|
9706
|
-
}
|
|
9707
|
-
}
|
|
9708
|
-
}
|
|
9669
|
+
if (isHTML) {
|
|
9670
|
+
translateDomVar(tag, nodeBinding);
|
|
9709
9671
|
}
|
|
9710
9672
|
const visitAccessor = nodeBinding && getScopeAccessorLiteral(nodeBinding);
|
|
9711
9673
|
if (visitAccessor) {
|
|
@@ -9852,7 +9814,7 @@ var html_script_default = {
|
|
|
9852
9814
|
} else {
|
|
9853
9815
|
const textLiteral = bodyToTextLiteral(tag.node.body);
|
|
9854
9816
|
if (import_compiler44.types.isStringLiteral(textLiteral)) {
|
|
9855
|
-
write`${textLiteral
|
|
9817
|
+
write`${textLiteral}`;
|
|
9856
9818
|
} else {
|
|
9857
9819
|
addStatement(
|
|
9858
9820
|
"render",
|
|
@@ -9952,7 +9914,6 @@ function getUsedAttrs2(tag) {
|
|
|
9952
9914
|
var import_compiler45 = require("@marko/compiler");
|
|
9953
9915
|
var import_babel_utils35 = require("@marko/compiler/babel-utils");
|
|
9954
9916
|
var kNodeBinding3 = Symbol("style tag node binding");
|
|
9955
|
-
var kGetterId4 = Symbol("node getter id");
|
|
9956
9917
|
var html_style_default = {
|
|
9957
9918
|
analyze(tag) {
|
|
9958
9919
|
(0, import_babel_utils35.assertNoArgs)(tag);
|
|
@@ -10034,25 +9995,12 @@ var html_style_default = {
|
|
|
10034
9995
|
)
|
|
10035
9996
|
);
|
|
10036
9997
|
}
|
|
9998
|
+
trackDomVarReferences(tag, nodeBinding);
|
|
10037
9999
|
addSerializeExpr(
|
|
10038
10000
|
tagSection,
|
|
10039
10001
|
!!(node.var || hasEventHandlers),
|
|
10040
10002
|
nodeBinding
|
|
10041
10003
|
);
|
|
10042
|
-
if (node.var) {
|
|
10043
|
-
for (const ref of tag.scope.getBinding(node.var.name).referencePaths) {
|
|
10044
|
-
const refSection = getOrCreateSection(ref);
|
|
10045
|
-
setReferencesScope(ref);
|
|
10046
|
-
if (isSameOrChildSection(tagSection, refSection)) {
|
|
10047
|
-
addOwnerSerializeReason(refSection, tagSection, true);
|
|
10048
|
-
if (!tagExtra[kGetterId4] && !isInvokedFunction(ref)) {
|
|
10049
|
-
tagExtra[kGetterId4] = getRegisterUID(tagSection, "#style");
|
|
10050
|
-
}
|
|
10051
|
-
} else {
|
|
10052
|
-
trackHoistedReference(ref, nodeBinding);
|
|
10053
|
-
}
|
|
10054
|
-
}
|
|
10055
|
-
}
|
|
10056
10004
|
addSerializeExpr(tagSection, push(exprExtras, tagExtra), nodeBinding);
|
|
10057
10005
|
}
|
|
10058
10006
|
},
|
|
@@ -10063,54 +10011,8 @@ var html_style_default = {
|
|
|
10063
10011
|
const isHTML = isOutputHTML();
|
|
10064
10012
|
const write = writeTo(tag);
|
|
10065
10013
|
const tagSection = getSection(tag);
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
const getterId = tagExtra[kGetterId4];
|
|
10069
|
-
if (isHTML) {
|
|
10070
|
-
translateVar(
|
|
10071
|
-
tag,
|
|
10072
|
-
callRuntime(
|
|
10073
|
-
"_el",
|
|
10074
|
-
getterId && getScopeIdIdentifier(tagSection),
|
|
10075
|
-
getterId && import_compiler45.types.stringLiteral(getterId)
|
|
10076
|
-
)
|
|
10077
|
-
);
|
|
10078
|
-
} else {
|
|
10079
|
-
const varName = tag.node.var.name;
|
|
10080
|
-
const references = tag.scope.getBinding(varName).referencePaths;
|
|
10081
|
-
let getterFnIdentifier;
|
|
10082
|
-
if (getterId) {
|
|
10083
|
-
getterFnIdentifier = generateUidIdentifier(`get_${varName}`);
|
|
10084
|
-
(0, import_babel_utils35.getProgram)().node.body.push(
|
|
10085
|
-
import_compiler45.types.variableDeclaration("const", [
|
|
10086
|
-
import_compiler45.types.variableDeclarator(
|
|
10087
|
-
getterFnIdentifier,
|
|
10088
|
-
callRuntime(
|
|
10089
|
-
"_el",
|
|
10090
|
-
import_compiler45.types.stringLiteral(getterId),
|
|
10091
|
-
getScopeAccessorLiteral(nodeBinding)
|
|
10092
|
-
)
|
|
10093
|
-
)
|
|
10094
|
-
])
|
|
10095
|
-
);
|
|
10096
|
-
}
|
|
10097
|
-
for (const reference of references) {
|
|
10098
|
-
const referenceSection = getSection(reference);
|
|
10099
|
-
if (isInvokedFunction(reference)) {
|
|
10100
|
-
reference.parentPath.replaceWith(
|
|
10101
|
-
import_compiler45.types.expressionStatement(
|
|
10102
|
-
createScopeReadExpression(referenceSection, nodeBinding)
|
|
10103
|
-
)
|
|
10104
|
-
);
|
|
10105
|
-
} else if (getterFnIdentifier) {
|
|
10106
|
-
reference.replaceWith(
|
|
10107
|
-
import_compiler45.types.callExpression(getterFnIdentifier, [
|
|
10108
|
-
getScopeExpression(referenceSection, getSection(tag))
|
|
10109
|
-
])
|
|
10110
|
-
);
|
|
10111
|
-
}
|
|
10112
|
-
}
|
|
10113
|
-
}
|
|
10014
|
+
if (isHTML) {
|
|
10015
|
+
translateDomVar(tag, nodeBinding);
|
|
10114
10016
|
}
|
|
10115
10017
|
const visitAccessor = nodeBinding && getScopeAccessorLiteral(nodeBinding);
|
|
10116
10018
|
if (visitAccessor) {
|