@vue/compat 3.3.9 → 3.4.0-alpha.2
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/vue.cjs.js +2238 -3746
- package/dist/vue.cjs.prod.js +1942 -3462
- package/dist/vue.esm-browser.js +2118 -1397
- package/dist/vue.esm-browser.prod.js +5 -5
- package/dist/vue.esm-bundler.js +2120 -1407
- package/dist/vue.global.js +2117 -1396
- package/dist/vue.global.prod.js +5 -5
- package/dist/vue.runtime.esm-browser.js +295 -234
- package/dist/vue.runtime.esm-browser.prod.js +5 -5
- package/dist/vue.runtime.esm-bundler.js +296 -243
- package/dist/vue.runtime.global.js +294 -233
- package/dist/vue.runtime.global.prod.js +5 -5
- package/package.json +2 -2
package/dist/vue.esm-browser.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
function makeMap(str, expectsLowerCase) {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
for (let i = 0; i < list.length; i++) {
|
|
5
|
-
map[list[i]] = true;
|
|
6
|
-
}
|
|
7
|
-
return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
|
|
2
|
+
const set = new Set(str.split(","));
|
|
3
|
+
return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
|
|
8
4
|
}
|
|
9
5
|
|
|
10
6
|
const EMPTY_OBJ = Object.freeze({}) ;
|
|
@@ -419,117 +415,120 @@ function onScopeDispose(fn) {
|
|
|
419
415
|
}
|
|
420
416
|
}
|
|
421
417
|
|
|
422
|
-
const createDep = (effects) => {
|
|
423
|
-
const dep = new Set(effects);
|
|
424
|
-
dep.w = 0;
|
|
425
|
-
dep.n = 0;
|
|
426
|
-
return dep;
|
|
427
|
-
};
|
|
428
|
-
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
429
|
-
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
430
|
-
const initDepMarkers = ({ deps }) => {
|
|
431
|
-
if (deps.length) {
|
|
432
|
-
for (let i = 0; i < deps.length; i++) {
|
|
433
|
-
deps[i].w |= trackOpBit;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
const finalizeDepMarkers = (effect) => {
|
|
438
|
-
const { deps } = effect;
|
|
439
|
-
if (deps.length) {
|
|
440
|
-
let ptr = 0;
|
|
441
|
-
for (let i = 0; i < deps.length; i++) {
|
|
442
|
-
const dep = deps[i];
|
|
443
|
-
if (wasTracked(dep) && !newTracked(dep)) {
|
|
444
|
-
dep.delete(effect);
|
|
445
|
-
} else {
|
|
446
|
-
deps[ptr++] = dep;
|
|
447
|
-
}
|
|
448
|
-
dep.w &= ~trackOpBit;
|
|
449
|
-
dep.n &= ~trackOpBit;
|
|
450
|
-
}
|
|
451
|
-
deps.length = ptr;
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
456
|
-
let effectTrackDepth = 0;
|
|
457
|
-
let trackOpBit = 1;
|
|
458
|
-
const maxMarkerBits = 30;
|
|
459
418
|
let activeEffect;
|
|
460
|
-
const ITERATE_KEY = Symbol("iterate" );
|
|
461
|
-
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
|
|
462
419
|
class ReactiveEffect {
|
|
463
|
-
constructor(fn, scheduler
|
|
420
|
+
constructor(fn, trigger, scheduler, scope) {
|
|
464
421
|
this.fn = fn;
|
|
422
|
+
this.trigger = trigger;
|
|
465
423
|
this.scheduler = scheduler;
|
|
466
424
|
this.active = true;
|
|
467
425
|
this.deps = [];
|
|
468
|
-
|
|
426
|
+
/**
|
|
427
|
+
* @internal
|
|
428
|
+
*/
|
|
429
|
+
this._dirtyLevel = 3;
|
|
430
|
+
/**
|
|
431
|
+
* @internal
|
|
432
|
+
*/
|
|
433
|
+
this._trackId = 0;
|
|
434
|
+
/**
|
|
435
|
+
* @internal
|
|
436
|
+
*/
|
|
437
|
+
this._runnings = 0;
|
|
438
|
+
/**
|
|
439
|
+
* @internal
|
|
440
|
+
*/
|
|
441
|
+
this._queryings = 0;
|
|
442
|
+
/**
|
|
443
|
+
* @internal
|
|
444
|
+
*/
|
|
445
|
+
this._depsLength = 0;
|
|
469
446
|
recordEffectScope(this, scope);
|
|
470
447
|
}
|
|
448
|
+
get dirty() {
|
|
449
|
+
if (this._dirtyLevel === 1) {
|
|
450
|
+
this._dirtyLevel = 0;
|
|
451
|
+
this._queryings++;
|
|
452
|
+
pauseTracking();
|
|
453
|
+
for (const dep of this.deps) {
|
|
454
|
+
if (dep.computed) {
|
|
455
|
+
triggerComputed(dep.computed);
|
|
456
|
+
if (this._dirtyLevel >= 2) {
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
resetTracking();
|
|
462
|
+
this._queryings--;
|
|
463
|
+
}
|
|
464
|
+
return this._dirtyLevel >= 2;
|
|
465
|
+
}
|
|
466
|
+
set dirty(v) {
|
|
467
|
+
this._dirtyLevel = v ? 3 : 0;
|
|
468
|
+
}
|
|
471
469
|
run() {
|
|
470
|
+
this._dirtyLevel = 0;
|
|
472
471
|
if (!this.active) {
|
|
473
472
|
return this.fn();
|
|
474
473
|
}
|
|
475
|
-
let parent = activeEffect;
|
|
476
474
|
let lastShouldTrack = shouldTrack;
|
|
477
|
-
|
|
478
|
-
if (parent === this) {
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
parent = parent.parent;
|
|
482
|
-
}
|
|
475
|
+
let lastEffect = activeEffect;
|
|
483
476
|
try {
|
|
484
|
-
this.parent = activeEffect;
|
|
485
|
-
activeEffect = this;
|
|
486
477
|
shouldTrack = true;
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
} else {
|
|
491
|
-
cleanupEffect(this);
|
|
492
|
-
}
|
|
478
|
+
activeEffect = this;
|
|
479
|
+
this._runnings++;
|
|
480
|
+
preCleanupEffect(this);
|
|
493
481
|
return this.fn();
|
|
494
482
|
} finally {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
trackOpBit = 1 << --effectTrackDepth;
|
|
499
|
-
activeEffect = this.parent;
|
|
483
|
+
postCleanupEffect(this);
|
|
484
|
+
this._runnings--;
|
|
485
|
+
activeEffect = lastEffect;
|
|
500
486
|
shouldTrack = lastShouldTrack;
|
|
501
|
-
this.parent = void 0;
|
|
502
|
-
if (this.deferStop) {
|
|
503
|
-
this.stop();
|
|
504
|
-
}
|
|
505
487
|
}
|
|
506
488
|
}
|
|
507
489
|
stop() {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
this.onStop();
|
|
514
|
-
}
|
|
490
|
+
var _a;
|
|
491
|
+
if (this.active) {
|
|
492
|
+
preCleanupEffect(this);
|
|
493
|
+
postCleanupEffect(this);
|
|
494
|
+
(_a = this.onStop) == null ? void 0 : _a.call(this);
|
|
515
495
|
this.active = false;
|
|
516
496
|
}
|
|
517
497
|
}
|
|
518
498
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
499
|
+
function triggerComputed(computed) {
|
|
500
|
+
return computed.value;
|
|
501
|
+
}
|
|
502
|
+
function preCleanupEffect(effect2) {
|
|
503
|
+
effect2._trackId++;
|
|
504
|
+
effect2._depsLength = 0;
|
|
505
|
+
}
|
|
506
|
+
function postCleanupEffect(effect2) {
|
|
507
|
+
if (effect2.deps && effect2.deps.length > effect2._depsLength) {
|
|
508
|
+
for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
|
|
509
|
+
cleanupDepEffect(effect2.deps[i], effect2);
|
|
510
|
+
}
|
|
511
|
+
effect2.deps.length = effect2._depsLength;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function cleanupDepEffect(dep, effect2) {
|
|
515
|
+
const trackId = dep.get(effect2);
|
|
516
|
+
if (trackId !== void 0 && effect2._trackId !== trackId) {
|
|
517
|
+
dep.delete(effect2);
|
|
518
|
+
if (dep.size === 0) {
|
|
519
|
+
dep.cleanup();
|
|
524
520
|
}
|
|
525
|
-
deps.length = 0;
|
|
526
521
|
}
|
|
527
522
|
}
|
|
528
523
|
function effect(fn, options) {
|
|
529
524
|
if (fn.effect instanceof ReactiveEffect) {
|
|
530
525
|
fn = fn.effect.fn;
|
|
531
526
|
}
|
|
532
|
-
const _effect = new ReactiveEffect(fn)
|
|
527
|
+
const _effect = new ReactiveEffect(fn, NOOP, () => {
|
|
528
|
+
if (_effect.dirty) {
|
|
529
|
+
_effect.run();
|
|
530
|
+
}
|
|
531
|
+
});
|
|
533
532
|
if (options) {
|
|
534
533
|
extend(_effect, options);
|
|
535
534
|
if (options.scope)
|
|
@@ -546,6 +545,7 @@ function stop(runner) {
|
|
|
546
545
|
runner.effect.stop();
|
|
547
546
|
}
|
|
548
547
|
let shouldTrack = true;
|
|
548
|
+
let pauseScheduleStack = 0;
|
|
549
549
|
const trackStack = [];
|
|
550
550
|
function pauseTracking() {
|
|
551
551
|
trackStack.push(shouldTrack);
|
|
@@ -555,6 +555,68 @@ function resetTracking() {
|
|
|
555
555
|
const last = trackStack.pop();
|
|
556
556
|
shouldTrack = last === void 0 ? true : last;
|
|
557
557
|
}
|
|
558
|
+
function pauseScheduling() {
|
|
559
|
+
pauseScheduleStack++;
|
|
560
|
+
}
|
|
561
|
+
function resetScheduling() {
|
|
562
|
+
pauseScheduleStack--;
|
|
563
|
+
while (!pauseScheduleStack && queueEffectSchedulers.length) {
|
|
564
|
+
queueEffectSchedulers.shift()();
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
function trackEffect(effect2, dep, debuggerEventExtraInfo) {
|
|
568
|
+
var _a;
|
|
569
|
+
if (dep.get(effect2) !== effect2._trackId) {
|
|
570
|
+
dep.set(effect2, effect2._trackId);
|
|
571
|
+
const oldDep = effect2.deps[effect2._depsLength];
|
|
572
|
+
if (oldDep !== dep) {
|
|
573
|
+
if (oldDep) {
|
|
574
|
+
cleanupDepEffect(oldDep, effect2);
|
|
575
|
+
}
|
|
576
|
+
effect2.deps[effect2._depsLength++] = dep;
|
|
577
|
+
} else {
|
|
578
|
+
effect2._depsLength++;
|
|
579
|
+
}
|
|
580
|
+
{
|
|
581
|
+
(_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
const queueEffectSchedulers = [];
|
|
586
|
+
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
587
|
+
var _a;
|
|
588
|
+
pauseScheduling();
|
|
589
|
+
for (const effect2 of dep.keys()) {
|
|
590
|
+
if (!effect2.allowRecurse && effect2._runnings) {
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
if (effect2._dirtyLevel < dirtyLevel && (!effect2._runnings || dirtyLevel !== 2)) {
|
|
594
|
+
const lastDirtyLevel = effect2._dirtyLevel;
|
|
595
|
+
effect2._dirtyLevel = dirtyLevel;
|
|
596
|
+
if (lastDirtyLevel === 0 && (!effect2._queryings || dirtyLevel !== 2)) {
|
|
597
|
+
{
|
|
598
|
+
(_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
599
|
+
}
|
|
600
|
+
effect2.trigger();
|
|
601
|
+
if (effect2.scheduler) {
|
|
602
|
+
queueEffectSchedulers.push(effect2.scheduler);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
resetScheduling();
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
const createDep = (cleanup, computed) => {
|
|
611
|
+
const dep = /* @__PURE__ */ new Map();
|
|
612
|
+
dep.cleanup = cleanup;
|
|
613
|
+
dep.computed = computed;
|
|
614
|
+
return dep;
|
|
615
|
+
};
|
|
616
|
+
|
|
617
|
+
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
618
|
+
const ITERATE_KEY = Symbol("iterate" );
|
|
619
|
+
const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
|
|
558
620
|
function track(target, type, key) {
|
|
559
621
|
if (shouldTrack && activeEffect) {
|
|
560
622
|
let depsMap = targetMap.get(target);
|
|
@@ -563,35 +625,17 @@ function track(target, type, key) {
|
|
|
563
625
|
}
|
|
564
626
|
let dep = depsMap.get(key);
|
|
565
627
|
if (!dep) {
|
|
566
|
-
depsMap.set(key, dep = createDep());
|
|
567
|
-
}
|
|
568
|
-
const eventInfo = { effect: activeEffect, target, type, key } ;
|
|
569
|
-
trackEffects(dep, eventInfo);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
function trackEffects(dep, debuggerEventExtraInfo) {
|
|
573
|
-
let shouldTrack2 = false;
|
|
574
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
575
|
-
if (!newTracked(dep)) {
|
|
576
|
-
dep.n |= trackOpBit;
|
|
577
|
-
shouldTrack2 = !wasTracked(dep);
|
|
578
|
-
}
|
|
579
|
-
} else {
|
|
580
|
-
shouldTrack2 = !dep.has(activeEffect);
|
|
581
|
-
}
|
|
582
|
-
if (shouldTrack2) {
|
|
583
|
-
dep.add(activeEffect);
|
|
584
|
-
activeEffect.deps.push(dep);
|
|
585
|
-
if (activeEffect.onTrack) {
|
|
586
|
-
activeEffect.onTrack(
|
|
587
|
-
extend(
|
|
588
|
-
{
|
|
589
|
-
effect: activeEffect
|
|
590
|
-
},
|
|
591
|
-
debuggerEventExtraInfo
|
|
592
|
-
)
|
|
593
|
-
);
|
|
628
|
+
depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
|
|
594
629
|
}
|
|
630
|
+
trackEffect(
|
|
631
|
+
activeEffect,
|
|
632
|
+
dep,
|
|
633
|
+
{
|
|
634
|
+
target,
|
|
635
|
+
type,
|
|
636
|
+
key
|
|
637
|
+
}
|
|
638
|
+
);
|
|
595
639
|
}
|
|
596
640
|
}
|
|
597
641
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
@@ -639,49 +683,24 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
639
683
|
break;
|
|
640
684
|
}
|
|
641
685
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
if (
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
triggerEffects(createDep(effects), eventInfo);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
662
|
-
const effects = isArray(dep) ? dep : [...dep];
|
|
663
|
-
for (const effect2 of effects) {
|
|
664
|
-
if (effect2.computed) {
|
|
665
|
-
triggerEffect(effect2, debuggerEventExtraInfo);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
for (const effect2 of effects) {
|
|
669
|
-
if (!effect2.computed) {
|
|
670
|
-
triggerEffect(effect2, debuggerEventExtraInfo);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
function triggerEffect(effect2, debuggerEventExtraInfo) {
|
|
675
|
-
if (effect2 !== activeEffect || effect2.allowRecurse) {
|
|
676
|
-
if (effect2.onTrigger) {
|
|
677
|
-
effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
678
|
-
}
|
|
679
|
-
if (effect2.scheduler) {
|
|
680
|
-
effect2.scheduler();
|
|
681
|
-
} else {
|
|
682
|
-
effect2.run();
|
|
686
|
+
pauseScheduling();
|
|
687
|
+
for (const dep of deps) {
|
|
688
|
+
if (dep) {
|
|
689
|
+
triggerEffects(
|
|
690
|
+
dep,
|
|
691
|
+
3,
|
|
692
|
+
{
|
|
693
|
+
target,
|
|
694
|
+
type,
|
|
695
|
+
key,
|
|
696
|
+
newValue,
|
|
697
|
+
oldValue,
|
|
698
|
+
oldTarget
|
|
699
|
+
}
|
|
700
|
+
);
|
|
683
701
|
}
|
|
684
702
|
}
|
|
703
|
+
resetScheduling();
|
|
685
704
|
}
|
|
686
705
|
function getDepFromReactive(object, key) {
|
|
687
706
|
var _a;
|
|
@@ -712,7 +731,9 @@ function createArrayInstrumentations() {
|
|
|
712
731
|
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
713
732
|
instrumentations[key] = function(...args) {
|
|
714
733
|
pauseTracking();
|
|
734
|
+
pauseScheduling();
|
|
715
735
|
const res = toRaw(this)[key].apply(this, args);
|
|
736
|
+
resetScheduling();
|
|
716
737
|
resetTracking();
|
|
717
738
|
return res;
|
|
718
739
|
};
|
|
@@ -1251,30 +1272,94 @@ function markRaw(value) {
|
|
|
1251
1272
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
1252
1273
|
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
1253
1274
|
|
|
1275
|
+
class ComputedRefImpl {
|
|
1276
|
+
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1277
|
+
this._setter = _setter;
|
|
1278
|
+
this.dep = void 0;
|
|
1279
|
+
this.__v_isRef = true;
|
|
1280
|
+
this["__v_isReadonly"] = false;
|
|
1281
|
+
this.effect = new ReactiveEffect(
|
|
1282
|
+
() => getter(this._value),
|
|
1283
|
+
() => triggerRefValue(this, 1)
|
|
1284
|
+
);
|
|
1285
|
+
this.effect.computed = this;
|
|
1286
|
+
this.effect.active = this._cacheable = !isSSR;
|
|
1287
|
+
this["__v_isReadonly"] = isReadonly;
|
|
1288
|
+
}
|
|
1289
|
+
get value() {
|
|
1290
|
+
const self = toRaw(this);
|
|
1291
|
+
trackRefValue(self);
|
|
1292
|
+
if (!self._cacheable || self.effect.dirty) {
|
|
1293
|
+
if (hasChanged(self._value, self._value = self.effect.run())) {
|
|
1294
|
+
triggerRefValue(self, 2);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
return self._value;
|
|
1298
|
+
}
|
|
1299
|
+
set value(newValue) {
|
|
1300
|
+
this._setter(newValue);
|
|
1301
|
+
}
|
|
1302
|
+
// #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
|
|
1303
|
+
get _dirty() {
|
|
1304
|
+
return this.effect.dirty;
|
|
1305
|
+
}
|
|
1306
|
+
set _dirty(v) {
|
|
1307
|
+
this.effect.dirty = v;
|
|
1308
|
+
}
|
|
1309
|
+
// #endregion
|
|
1310
|
+
}
|
|
1311
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1312
|
+
let getter;
|
|
1313
|
+
let setter;
|
|
1314
|
+
const onlyGetter = isFunction(getterOrOptions);
|
|
1315
|
+
if (onlyGetter) {
|
|
1316
|
+
getter = getterOrOptions;
|
|
1317
|
+
setter = () => {
|
|
1318
|
+
console.warn("Write operation failed: computed value is readonly");
|
|
1319
|
+
} ;
|
|
1320
|
+
} else {
|
|
1321
|
+
getter = getterOrOptions.get;
|
|
1322
|
+
setter = getterOrOptions.set;
|
|
1323
|
+
}
|
|
1324
|
+
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1325
|
+
if (debugOptions && !isSSR) {
|
|
1326
|
+
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1327
|
+
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1328
|
+
}
|
|
1329
|
+
return cRef;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1254
1332
|
function trackRefValue(ref2) {
|
|
1255
1333
|
if (shouldTrack && activeEffect) {
|
|
1256
1334
|
ref2 = toRaw(ref2);
|
|
1257
|
-
|
|
1258
|
-
|
|
1335
|
+
trackEffect(
|
|
1336
|
+
activeEffect,
|
|
1337
|
+
ref2.dep || (ref2.dep = createDep(
|
|
1338
|
+
() => ref2.dep = void 0,
|
|
1339
|
+
ref2 instanceof ComputedRefImpl ? ref2 : void 0
|
|
1340
|
+
)),
|
|
1341
|
+
{
|
|
1259
1342
|
target: ref2,
|
|
1260
1343
|
type: "get",
|
|
1261
1344
|
key: "value"
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1345
|
+
}
|
|
1346
|
+
);
|
|
1264
1347
|
}
|
|
1265
1348
|
}
|
|
1266
|
-
function triggerRefValue(ref2, newVal) {
|
|
1349
|
+
function triggerRefValue(ref2, dirtyLevel = 3, newVal) {
|
|
1267
1350
|
ref2 = toRaw(ref2);
|
|
1268
1351
|
const dep = ref2.dep;
|
|
1269
1352
|
if (dep) {
|
|
1270
|
-
|
|
1271
|
-
|
|
1353
|
+
triggerEffects(
|
|
1354
|
+
dep,
|
|
1355
|
+
dirtyLevel,
|
|
1356
|
+
{
|
|
1272
1357
|
target: ref2,
|
|
1273
1358
|
type: "set",
|
|
1274
1359
|
key: "value",
|
|
1275
1360
|
newValue: newVal
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1361
|
+
}
|
|
1362
|
+
);
|
|
1278
1363
|
}
|
|
1279
1364
|
}
|
|
1280
1365
|
function isRef(r) {
|
|
@@ -1310,12 +1395,12 @@ class RefImpl {
|
|
|
1310
1395
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1311
1396
|
this._rawValue = newVal;
|
|
1312
1397
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1313
|
-
triggerRefValue(this, newVal);
|
|
1398
|
+
triggerRefValue(this, 3, newVal);
|
|
1314
1399
|
}
|
|
1315
1400
|
}
|
|
1316
1401
|
}
|
|
1317
1402
|
function triggerRef(ref2) {
|
|
1318
|
-
triggerRefValue(ref2, ref2.value );
|
|
1403
|
+
triggerRefValue(ref2, 3, ref2.value );
|
|
1319
1404
|
}
|
|
1320
1405
|
function unref(ref2) {
|
|
1321
1406
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1413,67 +1498,16 @@ function propertyToRef(source, key, defaultValue) {
|
|
|
1413
1498
|
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1414
1499
|
}
|
|
1415
1500
|
|
|
1416
|
-
|
|
1417
|
-
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1418
|
-
this._setter = _setter;
|
|
1419
|
-
this.dep = void 0;
|
|
1420
|
-
this.__v_isRef = true;
|
|
1421
|
-
this["__v_isReadonly"] = false;
|
|
1422
|
-
this._dirty = true;
|
|
1423
|
-
this.effect = new ReactiveEffect(getter, () => {
|
|
1424
|
-
if (!this._dirty) {
|
|
1425
|
-
this._dirty = true;
|
|
1426
|
-
triggerRefValue(this);
|
|
1427
|
-
}
|
|
1428
|
-
});
|
|
1429
|
-
this.effect.computed = this;
|
|
1430
|
-
this.effect.active = this._cacheable = !isSSR;
|
|
1431
|
-
this["__v_isReadonly"] = isReadonly;
|
|
1432
|
-
}
|
|
1433
|
-
get value() {
|
|
1434
|
-
const self = toRaw(this);
|
|
1435
|
-
trackRefValue(self);
|
|
1436
|
-
if (self._dirty || !self._cacheable) {
|
|
1437
|
-
self._dirty = false;
|
|
1438
|
-
self._value = self.effect.run();
|
|
1439
|
-
}
|
|
1440
|
-
return self._value;
|
|
1441
|
-
}
|
|
1442
|
-
set value(newValue) {
|
|
1443
|
-
this._setter(newValue);
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1447
|
-
let getter;
|
|
1448
|
-
let setter;
|
|
1449
|
-
const onlyGetter = isFunction(getterOrOptions);
|
|
1450
|
-
if (onlyGetter) {
|
|
1451
|
-
getter = getterOrOptions;
|
|
1452
|
-
setter = () => {
|
|
1453
|
-
console.warn("Write operation failed: computed value is readonly");
|
|
1454
|
-
} ;
|
|
1455
|
-
} else {
|
|
1456
|
-
getter = getterOrOptions.get;
|
|
1457
|
-
setter = getterOrOptions.set;
|
|
1458
|
-
}
|
|
1459
|
-
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1460
|
-
if (debugOptions && !isSSR) {
|
|
1461
|
-
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1462
|
-
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1463
|
-
}
|
|
1464
|
-
return cRef;
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
const stack = [];
|
|
1501
|
+
const stack$1 = [];
|
|
1468
1502
|
function pushWarningContext(vnode) {
|
|
1469
|
-
stack.push(vnode);
|
|
1503
|
+
stack$1.push(vnode);
|
|
1470
1504
|
}
|
|
1471
1505
|
function popWarningContext() {
|
|
1472
|
-
stack.pop();
|
|
1506
|
+
stack$1.pop();
|
|
1473
1507
|
}
|
|
1474
1508
|
function warn(msg, ...args) {
|
|
1475
1509
|
pauseTracking();
|
|
1476
|
-
const instance = stack.length ? stack[stack.length - 1].component : null;
|
|
1510
|
+
const instance = stack$1.length ? stack$1[stack$1.length - 1].component : null;
|
|
1477
1511
|
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
1478
1512
|
const trace = getComponentTrace();
|
|
1479
1513
|
if (appWarnHandler) {
|
|
@@ -1502,7 +1536,7 @@ function warn(msg, ...args) {
|
|
|
1502
1536
|
resetTracking();
|
|
1503
1537
|
}
|
|
1504
1538
|
function getComponentTrace() {
|
|
1505
|
-
let currentVNode = stack[stack.length - 1];
|
|
1539
|
+
let currentVNode = stack$1[stack$1.length - 1];
|
|
1506
1540
|
if (!currentVNode) {
|
|
1507
1541
|
return [];
|
|
1508
1542
|
}
|
|
@@ -1578,7 +1612,7 @@ function assertNumber(val, type) {
|
|
|
1578
1612
|
}
|
|
1579
1613
|
}
|
|
1580
1614
|
|
|
1581
|
-
const ErrorTypeStrings = {
|
|
1615
|
+
const ErrorTypeStrings$1 = {
|
|
1582
1616
|
["sp"]: "serverPrefetch hook",
|
|
1583
1617
|
["bc"]: "beforeCreate hook",
|
|
1584
1618
|
["c"]: "created hook",
|
|
@@ -1639,7 +1673,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1639
1673
|
if (instance) {
|
|
1640
1674
|
let cur = instance.parent;
|
|
1641
1675
|
const exposedInstance = instance.proxy;
|
|
1642
|
-
const errorInfo = ErrorTypeStrings[type] ;
|
|
1676
|
+
const errorInfo = ErrorTypeStrings$1[type] ;
|
|
1643
1677
|
while (cur) {
|
|
1644
1678
|
const errorCapturedHooks = cur.ec;
|
|
1645
1679
|
if (errorCapturedHooks) {
|
|
@@ -1666,7 +1700,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1666
1700
|
}
|
|
1667
1701
|
function logError(err, type, contextVNode, throwInDev = true) {
|
|
1668
1702
|
{
|
|
1669
|
-
const info = ErrorTypeStrings[type];
|
|
1703
|
+
const info = ErrorTypeStrings$1[type];
|
|
1670
1704
|
if (contextVNode) {
|
|
1671
1705
|
pushWarningContext(contextVNode);
|
|
1672
1706
|
}
|
|
@@ -1894,6 +1928,7 @@ function rerender(id, newRender) {
|
|
|
1894
1928
|
}
|
|
1895
1929
|
instance.renderCache = [];
|
|
1896
1930
|
isHmrUpdating = true;
|
|
1931
|
+
instance.effect.dirty = true;
|
|
1897
1932
|
instance.update();
|
|
1898
1933
|
isHmrUpdating = false;
|
|
1899
1934
|
});
|
|
@@ -1921,6 +1956,7 @@ function reload(id, newComp) {
|
|
|
1921
1956
|
instance.ceReload(newComp.styles);
|
|
1922
1957
|
hmrDirtyComponents.delete(oldComp);
|
|
1923
1958
|
} else if (instance.parent) {
|
|
1959
|
+
instance.parent.effect.dirty = true;
|
|
1924
1960
|
queueJob(instance.parent.update);
|
|
1925
1961
|
} else if (instance.appContext.reload) {
|
|
1926
1962
|
instance.appContext.reload();
|
|
@@ -3685,8 +3721,15 @@ function watch(source, cb, options) {
|
|
|
3685
3721
|
}
|
|
3686
3722
|
return doWatch(source, cb, options);
|
|
3687
3723
|
}
|
|
3688
|
-
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3724
|
+
function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3689
3725
|
var _a;
|
|
3726
|
+
if (cb && once) {
|
|
3727
|
+
const _cb = cb;
|
|
3728
|
+
cb = (...args) => {
|
|
3729
|
+
_cb(...args);
|
|
3730
|
+
unwatch();
|
|
3731
|
+
};
|
|
3732
|
+
}
|
|
3690
3733
|
if (!cb) {
|
|
3691
3734
|
if (immediate !== void 0) {
|
|
3692
3735
|
warn(
|
|
@@ -3698,6 +3741,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3698
3741
|
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
3699
3742
|
);
|
|
3700
3743
|
}
|
|
3744
|
+
if (once !== void 0) {
|
|
3745
|
+
warn(
|
|
3746
|
+
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
3747
|
+
);
|
|
3748
|
+
}
|
|
3701
3749
|
}
|
|
3702
3750
|
const warnInvalidSource = (s) => {
|
|
3703
3751
|
warn(
|
|
@@ -3776,7 +3824,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3776
3824
|
};
|
|
3777
3825
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
3778
3826
|
const job = () => {
|
|
3779
|
-
if (!effect.active) {
|
|
3827
|
+
if (!effect.active || !effect.dirty) {
|
|
3780
3828
|
return;
|
|
3781
3829
|
}
|
|
3782
3830
|
if (cb) {
|
|
@@ -3809,7 +3857,13 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3809
3857
|
job.id = instance.uid;
|
|
3810
3858
|
scheduler = () => queueJob(job);
|
|
3811
3859
|
}
|
|
3812
|
-
const effect = new ReactiveEffect(getter, scheduler);
|
|
3860
|
+
const effect = new ReactiveEffect(getter, NOOP, scheduler);
|
|
3861
|
+
const unwatch = () => {
|
|
3862
|
+
effect.stop();
|
|
3863
|
+
if (instance && instance.scope) {
|
|
3864
|
+
remove(instance.scope.effects, effect);
|
|
3865
|
+
}
|
|
3866
|
+
};
|
|
3813
3867
|
{
|
|
3814
3868
|
effect.onTrack = onTrack;
|
|
3815
3869
|
effect.onTrigger = onTrigger;
|
|
@@ -3828,12 +3882,6 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3828
3882
|
} else {
|
|
3829
3883
|
effect.run();
|
|
3830
3884
|
}
|
|
3831
|
-
const unwatch = () => {
|
|
3832
|
-
effect.stop();
|
|
3833
|
-
if (instance && instance.scope) {
|
|
3834
|
-
remove(instance.scope.effects, effect);
|
|
3835
|
-
}
|
|
3836
|
-
};
|
|
3837
3885
|
return unwatch;
|
|
3838
3886
|
}
|
|
3839
3887
|
function instanceWatch(source, value, options) {
|
|
@@ -4066,6 +4114,7 @@ const BaseTransitionImpl = {
|
|
|
4066
4114
|
leavingHooks.afterLeave = () => {
|
|
4067
4115
|
state.isLeaving = false;
|
|
4068
4116
|
if (instance.update.active !== false) {
|
|
4117
|
+
instance.effect.dirty = true;
|
|
4069
4118
|
instance.update();
|
|
4070
4119
|
}
|
|
4071
4120
|
};
|
|
@@ -4408,6 +4457,7 @@ function defineAsyncComponent(source) {
|
|
|
4408
4457
|
load().then(() => {
|
|
4409
4458
|
loaded.value = true;
|
|
4410
4459
|
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
4460
|
+
instance.parent.effect.dirty = true;
|
|
4411
4461
|
queueJob(instance.parent.update);
|
|
4412
4462
|
}
|
|
4413
4463
|
}).catch((err) => {
|
|
@@ -4705,7 +4755,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4705
4755
|
}
|
|
4706
4756
|
return wrappedHook;
|
|
4707
4757
|
} else {
|
|
4708
|
-
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
|
|
4758
|
+
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
4709
4759
|
warn(
|
|
4710
4760
|
`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
|
|
4711
4761
|
);
|
|
@@ -5368,7 +5418,10 @@ const publicPropertiesMap = (
|
|
|
5368
5418
|
$root: (i) => getPublicInstance(i.root),
|
|
5369
5419
|
$emit: (i) => i.emit,
|
|
5370
5420
|
$options: (i) => resolveMergedOptions(i) ,
|
|
5371
|
-
$forceUpdate: (i) => i.f || (i.f = () =>
|
|
5421
|
+
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
5422
|
+
i.effect.dirty = true;
|
|
5423
|
+
queueJob(i.update);
|
|
5424
|
+
}),
|
|
5372
5425
|
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
5373
5426
|
$watch: (i) => instanceWatch.bind(i)
|
|
5374
5427
|
})
|
|
@@ -6269,7 +6322,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6269
6322
|
return vm;
|
|
6270
6323
|
}
|
|
6271
6324
|
}
|
|
6272
|
-
Vue.version = `2.6.14-compat:${"3.
|
|
6325
|
+
Vue.version = `2.6.14-compat:${"3.4.0-alpha.2"}`;
|
|
6273
6326
|
Vue.config = singletonApp.config;
|
|
6274
6327
|
Vue.use = (p, ...options) => {
|
|
6275
6328
|
if (p && isFunction(p.install)) {
|
|
@@ -8692,6 +8745,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8692
8745
|
} else {
|
|
8693
8746
|
instance.next = n2;
|
|
8694
8747
|
invalidateJob(instance.update);
|
|
8748
|
+
instance.effect.dirty = true;
|
|
8695
8749
|
instance.update();
|
|
8696
8750
|
}
|
|
8697
8751
|
} else {
|
|
@@ -8885,11 +8939,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8885
8939
|
};
|
|
8886
8940
|
const effect = instance.effect = new ReactiveEffect(
|
|
8887
8941
|
componentUpdateFn,
|
|
8942
|
+
NOOP,
|
|
8888
8943
|
() => queueJob(update),
|
|
8889
8944
|
instance.scope
|
|
8890
8945
|
// track it in component's effect scope
|
|
8891
8946
|
);
|
|
8892
|
-
const update = instance.update = () =>
|
|
8947
|
+
const update = instance.update = () => {
|
|
8948
|
+
if (effect.dirty) {
|
|
8949
|
+
effect.run();
|
|
8950
|
+
}
|
|
8951
|
+
};
|
|
8893
8952
|
update.id = instance.uid;
|
|
8894
8953
|
toggleRecurse(instance, true);
|
|
8895
8954
|
{
|
|
@@ -10862,7 +10921,8 @@ function isMemoSame(cached, memo) {
|
|
|
10862
10921
|
return true;
|
|
10863
10922
|
}
|
|
10864
10923
|
|
|
10865
|
-
const version = "3.
|
|
10924
|
+
const version = "3.4.0-alpha.2";
|
|
10925
|
+
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10866
10926
|
const ssrUtils = null;
|
|
10867
10927
|
const resolveFilter = resolveFilter$1 ;
|
|
10868
10928
|
const _compatUtils = {
|
|
@@ -12497,6 +12557,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12497
12557
|
BaseTransitionPropsValidators: BaseTransitionPropsValidators,
|
|
12498
12558
|
Comment: Comment,
|
|
12499
12559
|
EffectScope: EffectScope,
|
|
12560
|
+
ErrorTypeStrings: ErrorTypeStrings,
|
|
12500
12561
|
Fragment: Fragment,
|
|
12501
12562
|
KeepAlive: KeepAlive,
|
|
12502
12563
|
ReactiveEffect: ReactiveEffect,
|
|
@@ -12680,83 +12741,6 @@ function createCompatVue() {
|
|
|
12680
12741
|
return Vue;
|
|
12681
12742
|
}
|
|
12682
12743
|
|
|
12683
|
-
function defaultOnError(error) {
|
|
12684
|
-
throw error;
|
|
12685
|
-
}
|
|
12686
|
-
function defaultOnWarn(msg) {
|
|
12687
|
-
console.warn(`[Vue warn] ${msg.message}`);
|
|
12688
|
-
}
|
|
12689
|
-
function createCompilerError(code, loc, messages, additionalMessage) {
|
|
12690
|
-
const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ;
|
|
12691
|
-
const error = new SyntaxError(String(msg));
|
|
12692
|
-
error.code = code;
|
|
12693
|
-
error.loc = loc;
|
|
12694
|
-
return error;
|
|
12695
|
-
}
|
|
12696
|
-
const errorMessages = {
|
|
12697
|
-
// parse errors
|
|
12698
|
-
[0]: "Illegal comment.",
|
|
12699
|
-
[1]: "CDATA section is allowed only in XML context.",
|
|
12700
|
-
[2]: "Duplicate attribute.",
|
|
12701
|
-
[3]: "End tag cannot have attributes.",
|
|
12702
|
-
[4]: "Illegal '/' in tags.",
|
|
12703
|
-
[5]: "Unexpected EOF in tag.",
|
|
12704
|
-
[6]: "Unexpected EOF in CDATA section.",
|
|
12705
|
-
[7]: "Unexpected EOF in comment.",
|
|
12706
|
-
[8]: "Unexpected EOF in script.",
|
|
12707
|
-
[9]: "Unexpected EOF in tag.",
|
|
12708
|
-
[10]: "Incorrectly closed comment.",
|
|
12709
|
-
[11]: "Incorrectly opened comment.",
|
|
12710
|
-
[12]: "Illegal tag name. Use '<' to print '<'.",
|
|
12711
|
-
[13]: "Attribute value was expected.",
|
|
12712
|
-
[14]: "End tag name was expected.",
|
|
12713
|
-
[15]: "Whitespace was expected.",
|
|
12714
|
-
[16]: "Unexpected '<!--' in comment.",
|
|
12715
|
-
[17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
|
|
12716
|
-
[18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
|
|
12717
|
-
[19]: "Attribute name cannot start with '='.",
|
|
12718
|
-
[21]: "'<?' is allowed only in XML context.",
|
|
12719
|
-
[20]: `Unexpected null character.`,
|
|
12720
|
-
[22]: "Illegal '/' in tags.",
|
|
12721
|
-
// Vue-specific parse errors
|
|
12722
|
-
[23]: "Invalid end tag.",
|
|
12723
|
-
[24]: "Element is missing end tag.",
|
|
12724
|
-
[25]: "Interpolation end sign was not found.",
|
|
12725
|
-
[27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
|
|
12726
|
-
[26]: "Legal directive name was expected.",
|
|
12727
|
-
// transform errors
|
|
12728
|
-
[28]: `v-if/v-else-if is missing expression.`,
|
|
12729
|
-
[29]: `v-if/else branches must use unique keys.`,
|
|
12730
|
-
[30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
|
|
12731
|
-
[31]: `v-for is missing expression.`,
|
|
12732
|
-
[32]: `v-for has invalid expression.`,
|
|
12733
|
-
[33]: `<template v-for> key should be placed on the <template> tag.`,
|
|
12734
|
-
[34]: `v-bind is missing expression.`,
|
|
12735
|
-
[35]: `v-on is missing expression.`,
|
|
12736
|
-
[36]: `Unexpected custom directive on <slot> outlet.`,
|
|
12737
|
-
[37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
|
|
12738
|
-
[38]: `Duplicate slot names found. `,
|
|
12739
|
-
[39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
|
|
12740
|
-
[40]: `v-slot can only be used on components or <template> tags.`,
|
|
12741
|
-
[41]: `v-model is missing expression.`,
|
|
12742
|
-
[42]: `v-model value must be a valid JavaScript member expression.`,
|
|
12743
|
-
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
12744
|
-
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
12745
|
-
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
12746
|
-
[45]: `Error parsing JavaScript expression: `,
|
|
12747
|
-
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
12748
|
-
// generic errors
|
|
12749
|
-
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
12750
|
-
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
12751
|
-
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
12752
|
-
[50]: `"scopeId" option is only supported in module mode.`,
|
|
12753
|
-
// deprecations
|
|
12754
|
-
[51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
12755
|
-
[52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
|
|
12756
|
-
// just to fulfill types
|
|
12757
|
-
[53]: ``
|
|
12758
|
-
};
|
|
12759
|
-
|
|
12760
12744
|
const FRAGMENT = Symbol(`Fragment` );
|
|
12761
12745
|
const TELEPORT = Symbol(`Teleport` );
|
|
12762
12746
|
const SUSPENSE = Symbol(`Suspense` );
|
|
@@ -12846,13 +12830,14 @@ function registerRuntimeHelpers(helpers) {
|
|
|
12846
12830
|
}
|
|
12847
12831
|
|
|
12848
12832
|
const locStub = {
|
|
12849
|
-
source: "",
|
|
12850
12833
|
start: { line: 1, column: 1, offset: 0 },
|
|
12851
|
-
end: { line: 1, column: 1, offset: 0 }
|
|
12834
|
+
end: { line: 1, column: 1, offset: 0 },
|
|
12835
|
+
source: ""
|
|
12852
12836
|
};
|
|
12853
|
-
function createRoot(children,
|
|
12837
|
+
function createRoot(children, source = "") {
|
|
12854
12838
|
return {
|
|
12855
12839
|
type: 0,
|
|
12840
|
+
source,
|
|
12856
12841
|
children,
|
|
12857
12842
|
helpers: /* @__PURE__ */ new Set(),
|
|
12858
12843
|
components: [],
|
|
@@ -12862,7 +12847,7 @@ function createRoot(children, loc = locStub) {
|
|
|
12862
12847
|
cached: 0,
|
|
12863
12848
|
temps: 0,
|
|
12864
12849
|
codegenNode: void 0,
|
|
12865
|
-
loc
|
|
12850
|
+
loc: locStub
|
|
12866
12851
|
};
|
|
12867
12852
|
}
|
|
12868
12853
|
function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {
|
|
@@ -12988,268 +12973,809 @@ function convertToBlock(node, { helper, removeHelper, inSSR }) {
|
|
|
12988
12973
|
}
|
|
12989
12974
|
}
|
|
12990
12975
|
|
|
12991
|
-
const
|
|
12992
|
-
const
|
|
12993
|
-
function
|
|
12994
|
-
|
|
12995
|
-
return TELEPORT;
|
|
12996
|
-
} else if (isBuiltInType(tag, "Suspense")) {
|
|
12997
|
-
return SUSPENSE;
|
|
12998
|
-
} else if (isBuiltInType(tag, "KeepAlive")) {
|
|
12999
|
-
return KEEP_ALIVE;
|
|
13000
|
-
} else if (isBuiltInType(tag, "BaseTransition")) {
|
|
13001
|
-
return BASE_TRANSITION;
|
|
13002
|
-
}
|
|
12976
|
+
const defaultDelimitersOpen = new Uint8Array([123, 123]);
|
|
12977
|
+
const defaultDelimitersClose = new Uint8Array([125, 125]);
|
|
12978
|
+
function isTagStartChar(c) {
|
|
12979
|
+
return c >= 97 && c <= 122 || c >= 65 && c <= 90;
|
|
13003
12980
|
}
|
|
13004
|
-
|
|
13005
|
-
|
|
13006
|
-
const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
|
|
13007
|
-
const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
|
|
13008
|
-
const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
|
|
13009
|
-
const isMemberExpressionBrowser = (path) => {
|
|
13010
|
-
path = path.trim().replace(whitespaceRE, (s) => s.trim());
|
|
13011
|
-
let state = 0 /* inMemberExp */;
|
|
13012
|
-
let stateStack = [];
|
|
13013
|
-
let currentOpenBracketCount = 0;
|
|
13014
|
-
let currentOpenParensCount = 0;
|
|
13015
|
-
let currentStringType = null;
|
|
13016
|
-
for (let i = 0; i < path.length; i++) {
|
|
13017
|
-
const char = path.charAt(i);
|
|
13018
|
-
switch (state) {
|
|
13019
|
-
case 0 /* inMemberExp */:
|
|
13020
|
-
if (char === "[") {
|
|
13021
|
-
stateStack.push(state);
|
|
13022
|
-
state = 1 /* inBrackets */;
|
|
13023
|
-
currentOpenBracketCount++;
|
|
13024
|
-
} else if (char === "(") {
|
|
13025
|
-
stateStack.push(state);
|
|
13026
|
-
state = 2 /* inParens */;
|
|
13027
|
-
currentOpenParensCount++;
|
|
13028
|
-
} else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
|
|
13029
|
-
return false;
|
|
13030
|
-
}
|
|
13031
|
-
break;
|
|
13032
|
-
case 1 /* inBrackets */:
|
|
13033
|
-
if (char === `'` || char === `"` || char === "`") {
|
|
13034
|
-
stateStack.push(state);
|
|
13035
|
-
state = 3 /* inString */;
|
|
13036
|
-
currentStringType = char;
|
|
13037
|
-
} else if (char === `[`) {
|
|
13038
|
-
currentOpenBracketCount++;
|
|
13039
|
-
} else if (char === `]`) {
|
|
13040
|
-
if (!--currentOpenBracketCount) {
|
|
13041
|
-
state = stateStack.pop();
|
|
13042
|
-
}
|
|
13043
|
-
}
|
|
13044
|
-
break;
|
|
13045
|
-
case 2 /* inParens */:
|
|
13046
|
-
if (char === `'` || char === `"` || char === "`") {
|
|
13047
|
-
stateStack.push(state);
|
|
13048
|
-
state = 3 /* inString */;
|
|
13049
|
-
currentStringType = char;
|
|
13050
|
-
} else if (char === `(`) {
|
|
13051
|
-
currentOpenParensCount++;
|
|
13052
|
-
} else if (char === `)`) {
|
|
13053
|
-
if (i === path.length - 1) {
|
|
13054
|
-
return false;
|
|
13055
|
-
}
|
|
13056
|
-
if (!--currentOpenParensCount) {
|
|
13057
|
-
state = stateStack.pop();
|
|
13058
|
-
}
|
|
13059
|
-
}
|
|
13060
|
-
break;
|
|
13061
|
-
case 3 /* inString */:
|
|
13062
|
-
if (char === currentStringType) {
|
|
13063
|
-
state = stateStack.pop();
|
|
13064
|
-
currentStringType = null;
|
|
13065
|
-
}
|
|
13066
|
-
break;
|
|
13067
|
-
}
|
|
13068
|
-
}
|
|
13069
|
-
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
13070
|
-
};
|
|
13071
|
-
const isMemberExpression = isMemberExpressionBrowser ;
|
|
13072
|
-
function getInnerRange(loc, offset, length) {
|
|
13073
|
-
const source = loc.source.slice(offset, offset + length);
|
|
13074
|
-
const newLoc = {
|
|
13075
|
-
source,
|
|
13076
|
-
start: advancePositionWithClone(loc.start, loc.source, offset),
|
|
13077
|
-
end: loc.end
|
|
13078
|
-
};
|
|
13079
|
-
if (length != null) {
|
|
13080
|
-
newLoc.end = advancePositionWithClone(
|
|
13081
|
-
loc.start,
|
|
13082
|
-
loc.source,
|
|
13083
|
-
offset + length
|
|
13084
|
-
);
|
|
13085
|
-
}
|
|
13086
|
-
return newLoc;
|
|
12981
|
+
function isWhitespace(c) {
|
|
12982
|
+
return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
|
|
13087
12983
|
}
|
|
13088
|
-
function
|
|
13089
|
-
return
|
|
13090
|
-
extend({}, pos),
|
|
13091
|
-
source,
|
|
13092
|
-
numberOfCharacters
|
|
13093
|
-
);
|
|
12984
|
+
function isEndOfTagSection(c) {
|
|
12985
|
+
return c === 47 || c === 62 || isWhitespace(c);
|
|
13094
12986
|
}
|
|
13095
|
-
function
|
|
13096
|
-
|
|
13097
|
-
let
|
|
13098
|
-
|
|
13099
|
-
if (source.charCodeAt(i) === 10) {
|
|
13100
|
-
linesCount++;
|
|
13101
|
-
lastNewLinePos = i;
|
|
13102
|
-
}
|
|
12987
|
+
function toCharCodes(str) {
|
|
12988
|
+
const ret = new Uint8Array(str.length);
|
|
12989
|
+
for (let i = 0; i < str.length; i++) {
|
|
12990
|
+
ret[i] = str.charCodeAt(i);
|
|
13103
12991
|
}
|
|
13104
|
-
|
|
13105
|
-
pos.line += linesCount;
|
|
13106
|
-
pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos;
|
|
13107
|
-
return pos;
|
|
12992
|
+
return ret;
|
|
13108
12993
|
}
|
|
13109
|
-
|
|
13110
|
-
|
|
13111
|
-
|
|
12994
|
+
const Sequences = {
|
|
12995
|
+
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
|
|
12996
|
+
// CDATA[
|
|
12997
|
+
CdataEnd: new Uint8Array([93, 93, 62]),
|
|
12998
|
+
// ]]>
|
|
12999
|
+
CommentEnd: new Uint8Array([45, 45, 62]),
|
|
13000
|
+
// `-->`
|
|
13001
|
+
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
|
|
13002
|
+
// `<\/script`
|
|
13003
|
+
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
|
|
13004
|
+
// `</style`
|
|
13005
|
+
TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),
|
|
13006
|
+
// `</title`
|
|
13007
|
+
TextareaEnd: new Uint8Array([
|
|
13008
|
+
60,
|
|
13009
|
+
47,
|
|
13010
|
+
116,
|
|
13011
|
+
101,
|
|
13012
|
+
120,
|
|
13013
|
+
116,
|
|
13014
|
+
97,
|
|
13015
|
+
114,
|
|
13016
|
+
101,
|
|
13017
|
+
97
|
|
13018
|
+
])
|
|
13019
|
+
// `</textarea
|
|
13020
|
+
};
|
|
13021
|
+
class Tokenizer {
|
|
13022
|
+
constructor(stack, cbs) {
|
|
13023
|
+
this.stack = stack;
|
|
13024
|
+
this.cbs = cbs;
|
|
13025
|
+
/** The current state the tokenizer is in. */
|
|
13026
|
+
this.state = 1;
|
|
13027
|
+
/** The read buffer. */
|
|
13028
|
+
this.buffer = "";
|
|
13029
|
+
/** The beginning of the section that is currently being read. */
|
|
13030
|
+
this.sectionStart = 0;
|
|
13031
|
+
/** The index within the buffer that we are currently looking at. */
|
|
13032
|
+
this.index = 0;
|
|
13033
|
+
/** The start of the last entity. */
|
|
13034
|
+
this.entityStart = 0;
|
|
13035
|
+
/** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
|
|
13036
|
+
this.baseState = 1;
|
|
13037
|
+
/** For special parsing behavior inside of script and style tags. */
|
|
13038
|
+
this.inRCDATA = false;
|
|
13039
|
+
/** For disabling RCDATA tags handling */
|
|
13040
|
+
this.inXML = false;
|
|
13041
|
+
/** Reocrd newline positions for fast line / column calculation */
|
|
13042
|
+
this.newlines = [];
|
|
13043
|
+
this.mode = 0;
|
|
13044
|
+
this.delimiterOpen = defaultDelimitersOpen;
|
|
13045
|
+
this.delimiterClose = defaultDelimitersClose;
|
|
13046
|
+
this.delimiterIndex = -1;
|
|
13047
|
+
this.currentSequence = void 0;
|
|
13048
|
+
this.sequenceIndex = 0;
|
|
13049
|
+
}
|
|
13050
|
+
get inSFCRoot() {
|
|
13051
|
+
return this.mode === 2 && this.stack.length === 0;
|
|
13052
|
+
}
|
|
13053
|
+
reset() {
|
|
13054
|
+
this.state = 1;
|
|
13055
|
+
this.mode = 0;
|
|
13056
|
+
this.buffer = "";
|
|
13057
|
+
this.sectionStart = 0;
|
|
13058
|
+
this.index = 0;
|
|
13059
|
+
this.baseState = 1;
|
|
13060
|
+
this.currentSequence = void 0;
|
|
13061
|
+
this.newlines.length = 0;
|
|
13062
|
+
this.delimiterOpen = defaultDelimitersOpen;
|
|
13063
|
+
this.delimiterClose = defaultDelimitersClose;
|
|
13112
13064
|
}
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13065
|
+
/**
|
|
13066
|
+
* Generate Position object with line / column information using recorded
|
|
13067
|
+
* newline positions. We know the index is always going to be an already
|
|
13068
|
+
* processed index, so all the newlines up to this index should have been
|
|
13069
|
+
* recorded.
|
|
13070
|
+
*/
|
|
13071
|
+
getPos(index) {
|
|
13072
|
+
let line = 1;
|
|
13073
|
+
let column = index + 1;
|
|
13074
|
+
for (let i = this.newlines.length - 1; i >= 0; i--) {
|
|
13075
|
+
const newlineIndex = this.newlines[i];
|
|
13076
|
+
if (index > newlineIndex) {
|
|
13077
|
+
line = i + 2;
|
|
13078
|
+
column = index - newlineIndex;
|
|
13079
|
+
break;
|
|
13080
|
+
}
|
|
13119
13081
|
}
|
|
13082
|
+
return {
|
|
13083
|
+
column,
|
|
13084
|
+
line,
|
|
13085
|
+
offset: index
|
|
13086
|
+
};
|
|
13120
13087
|
}
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
if (
|
|
13126
|
-
if (
|
|
13127
|
-
|
|
13128
|
-
if (p.name === name && (p.value || allowEmpty)) {
|
|
13129
|
-
return p;
|
|
13088
|
+
peek() {
|
|
13089
|
+
return this.buffer.charCodeAt(this.index + 1);
|
|
13090
|
+
}
|
|
13091
|
+
stateText(c) {
|
|
13092
|
+
if (c === 60) {
|
|
13093
|
+
if (this.index > this.sectionStart) {
|
|
13094
|
+
this.cbs.ontext(this.sectionStart, this.index);
|
|
13130
13095
|
}
|
|
13131
|
-
|
|
13132
|
-
|
|
13096
|
+
this.state = 5;
|
|
13097
|
+
this.sectionStart = this.index;
|
|
13098
|
+
} else if (c === this.delimiterOpen[0]) {
|
|
13099
|
+
this.state = 2;
|
|
13100
|
+
this.delimiterIndex = 0;
|
|
13101
|
+
this.stateInterpolationOpen(c);
|
|
13133
13102
|
}
|
|
13134
13103
|
}
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
|
|
13140
|
-
|
|
13141
|
-
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
}
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
function isTemplateNode(node) {
|
|
13154
|
-
return node.type === 1 && node.tagType === 3;
|
|
13155
|
-
}
|
|
13156
|
-
function isSlotOutlet(node) {
|
|
13157
|
-
return node.type === 1 && node.tagType === 2;
|
|
13158
|
-
}
|
|
13159
|
-
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
13160
|
-
function getUnnormalizedProps(props, callPath = []) {
|
|
13161
|
-
if (props && !isString(props) && props.type === 14) {
|
|
13162
|
-
const callee = props.callee;
|
|
13163
|
-
if (!isString(callee) && propsHelperSet.has(callee)) {
|
|
13164
|
-
return getUnnormalizedProps(
|
|
13165
|
-
props.arguments[0],
|
|
13166
|
-
callPath.concat(props)
|
|
13167
|
-
);
|
|
13104
|
+
stateInterpolationOpen(c) {
|
|
13105
|
+
if (c === this.delimiterOpen[this.delimiterIndex]) {
|
|
13106
|
+
if (this.delimiterIndex === this.delimiterOpen.length - 1) {
|
|
13107
|
+
const start = this.index + 1 - this.delimiterOpen.length;
|
|
13108
|
+
if (start > this.sectionStart) {
|
|
13109
|
+
this.cbs.ontext(this.sectionStart, start);
|
|
13110
|
+
}
|
|
13111
|
+
this.state = 3;
|
|
13112
|
+
this.sectionStart = start;
|
|
13113
|
+
} else {
|
|
13114
|
+
this.delimiterIndex++;
|
|
13115
|
+
}
|
|
13116
|
+
} else if (this.inRCDATA) {
|
|
13117
|
+
this.state = 32;
|
|
13118
|
+
this.stateInRCDATA(c);
|
|
13119
|
+
} else {
|
|
13120
|
+
this.state = 1;
|
|
13121
|
+
this.stateText(c);
|
|
13168
13122
|
}
|
|
13169
13123
|
}
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
let parentCall;
|
|
13177
|
-
if (props && !isString(props) && props.type === 14) {
|
|
13178
|
-
const ret = getUnnormalizedProps(props);
|
|
13179
|
-
props = ret[0];
|
|
13180
|
-
callPath = ret[1];
|
|
13181
|
-
parentCall = callPath[callPath.length - 1];
|
|
13124
|
+
stateInterpolation(c) {
|
|
13125
|
+
if (c === this.delimiterClose[0]) {
|
|
13126
|
+
this.state = 4;
|
|
13127
|
+
this.delimiterIndex = 0;
|
|
13128
|
+
this.stateInterpolationClose(c);
|
|
13129
|
+
}
|
|
13182
13130
|
}
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13131
|
+
stateInterpolationClose(c) {
|
|
13132
|
+
if (c === this.delimiterClose[this.delimiterIndex]) {
|
|
13133
|
+
if (this.delimiterIndex === this.delimiterClose.length - 1) {
|
|
13134
|
+
this.cbs.oninterpolation(this.sectionStart, this.index + 1);
|
|
13135
|
+
if (this.inRCDATA) {
|
|
13136
|
+
this.state = 32;
|
|
13137
|
+
} else {
|
|
13138
|
+
this.state = 1;
|
|
13139
|
+
}
|
|
13140
|
+
this.sectionStart = this.index + 1;
|
|
13141
|
+
} else {
|
|
13142
|
+
this.delimiterIndex++;
|
|
13190
13143
|
}
|
|
13191
13144
|
} else {
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13145
|
+
this.state = 3;
|
|
13146
|
+
this.stateInterpolation(c);
|
|
13147
|
+
}
|
|
13148
|
+
}
|
|
13149
|
+
stateSpecialStartSequence(c) {
|
|
13150
|
+
const isEnd = this.sequenceIndex === this.currentSequence.length;
|
|
13151
|
+
const isMatch = isEnd ? (
|
|
13152
|
+
// If we are at the end of the sequence, make sure the tag name has ended
|
|
13153
|
+
isEndOfTagSection(c)
|
|
13154
|
+
) : (
|
|
13155
|
+
// Otherwise, do a case-insensitive comparison
|
|
13156
|
+
(c | 32) === this.currentSequence[this.sequenceIndex]
|
|
13157
|
+
);
|
|
13158
|
+
if (!isMatch) {
|
|
13159
|
+
this.inRCDATA = false;
|
|
13160
|
+
} else if (!isEnd) {
|
|
13161
|
+
this.sequenceIndex++;
|
|
13162
|
+
return;
|
|
13163
|
+
}
|
|
13164
|
+
this.sequenceIndex = 0;
|
|
13165
|
+
this.state = 6;
|
|
13166
|
+
this.stateInTagName(c);
|
|
13167
|
+
}
|
|
13168
|
+
/** Look for an end tag. For <title> and <textarea>, also decode entities. */
|
|
13169
|
+
stateInRCDATA(c) {
|
|
13170
|
+
if (this.sequenceIndex === this.currentSequence.length) {
|
|
13171
|
+
if (c === 62 || isWhitespace(c)) {
|
|
13172
|
+
const endOfText = this.index - this.currentSequence.length;
|
|
13173
|
+
if (this.sectionStart < endOfText) {
|
|
13174
|
+
const actualIndex = this.index;
|
|
13175
|
+
this.index = endOfText;
|
|
13176
|
+
this.cbs.ontext(this.sectionStart, endOfText);
|
|
13177
|
+
this.index = actualIndex;
|
|
13178
|
+
}
|
|
13179
|
+
this.sectionStart = endOfText + 2;
|
|
13180
|
+
this.stateInClosingTagName(c);
|
|
13181
|
+
this.inRCDATA = false;
|
|
13182
|
+
return;
|
|
13199
13183
|
}
|
|
13184
|
+
this.sequenceIndex = 0;
|
|
13200
13185
|
}
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
if (
|
|
13204
|
-
|
|
13186
|
+
if ((c | 32) === this.currentSequence[this.sequenceIndex]) {
|
|
13187
|
+
this.sequenceIndex += 1;
|
|
13188
|
+
} else if (this.sequenceIndex === 0) {
|
|
13189
|
+
if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
|
|
13190
|
+
if (c === this.delimiterOpen[0]) {
|
|
13191
|
+
this.state = 2;
|
|
13192
|
+
this.delimiterIndex = 0;
|
|
13193
|
+
this.stateInterpolationOpen(c);
|
|
13194
|
+
}
|
|
13195
|
+
} else if (this.fastForwardTo(60)) {
|
|
13196
|
+
this.sequenceIndex = 1;
|
|
13197
|
+
}
|
|
13198
|
+
} else {
|
|
13199
|
+
this.sequenceIndex = Number(c === 60);
|
|
13205
13200
|
}
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13201
|
+
}
|
|
13202
|
+
stateCDATASequence(c) {
|
|
13203
|
+
if (c === Sequences.Cdata[this.sequenceIndex]) {
|
|
13204
|
+
if (++this.sequenceIndex === Sequences.Cdata.length) {
|
|
13205
|
+
this.state = 28;
|
|
13206
|
+
this.currentSequence = Sequences.CdataEnd;
|
|
13207
|
+
this.sequenceIndex = 0;
|
|
13208
|
+
this.sectionStart = this.index + 1;
|
|
13209
|
+
}
|
|
13210
|
+
} else {
|
|
13211
|
+
this.sequenceIndex = 0;
|
|
13212
|
+
this.state = 23;
|
|
13213
|
+
this.stateInDeclaration(c);
|
|
13214
13214
|
}
|
|
13215
13215
|
}
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13216
|
+
/**
|
|
13217
|
+
* When we wait for one specific character, we can speed things up
|
|
13218
|
+
* by skipping through the buffer until we find it.
|
|
13219
|
+
*
|
|
13220
|
+
* @returns Whether the character was found.
|
|
13221
|
+
*/
|
|
13222
|
+
fastForwardTo(c) {
|
|
13223
|
+
while (++this.index < this.buffer.length) {
|
|
13224
|
+
const cc = this.buffer.charCodeAt(this.index);
|
|
13225
|
+
if (cc === 10) {
|
|
13226
|
+
this.newlines.push(this.index);
|
|
13227
|
+
}
|
|
13228
|
+
if (cc === c) {
|
|
13229
|
+
return true;
|
|
13230
|
+
}
|
|
13231
|
+
}
|
|
13232
|
+
this.index = this.buffer.length - 1;
|
|
13233
|
+
return false;
|
|
13234
|
+
}
|
|
13235
|
+
/**
|
|
13236
|
+
* Comments and CDATA end with `-->` and `]]>`.
|
|
13237
|
+
*
|
|
13238
|
+
* Their common qualities are:
|
|
13239
|
+
* - Their end sequences have a distinct character they start with.
|
|
13240
|
+
* - That character is then repeated, so we have to check multiple repeats.
|
|
13241
|
+
* - All characters but the start character of the sequence can be skipped.
|
|
13242
|
+
*/
|
|
13243
|
+
stateInCommentLike(c) {
|
|
13244
|
+
if (c === this.currentSequence[this.sequenceIndex]) {
|
|
13245
|
+
if (++this.sequenceIndex === this.currentSequence.length) {
|
|
13246
|
+
if (this.currentSequence === Sequences.CdataEnd) {
|
|
13247
|
+
this.cbs.oncdata(this.sectionStart, this.index - 2);
|
|
13248
|
+
} else {
|
|
13249
|
+
this.cbs.oncomment(this.sectionStart, this.index - 2);
|
|
13250
|
+
}
|
|
13251
|
+
this.sequenceIndex = 0;
|
|
13252
|
+
this.sectionStart = this.index + 1;
|
|
13253
|
+
this.state = 1;
|
|
13254
|
+
}
|
|
13255
|
+
} else if (this.sequenceIndex === 0) {
|
|
13256
|
+
if (this.fastForwardTo(this.currentSequence[0])) {
|
|
13257
|
+
this.sequenceIndex = 1;
|
|
13258
|
+
}
|
|
13259
|
+
} else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
|
|
13260
|
+
this.sequenceIndex = 0;
|
|
13261
|
+
}
|
|
13262
|
+
}
|
|
13263
|
+
startSpecial(sequence, offset) {
|
|
13264
|
+
this.enterRCDATA(sequence, offset);
|
|
13265
|
+
this.state = 31;
|
|
13266
|
+
}
|
|
13267
|
+
enterRCDATA(sequence, offset) {
|
|
13268
|
+
this.inRCDATA = true;
|
|
13269
|
+
this.currentSequence = sequence;
|
|
13270
|
+
this.sequenceIndex = offset;
|
|
13271
|
+
}
|
|
13272
|
+
stateBeforeTagName(c) {
|
|
13273
|
+
if (c === 33) {
|
|
13274
|
+
this.state = 22;
|
|
13275
|
+
this.sectionStart = this.index + 1;
|
|
13276
|
+
} else if (c === 63) {
|
|
13277
|
+
this.state = 24;
|
|
13278
|
+
this.sectionStart = this.index + 1;
|
|
13279
|
+
} else if (isTagStartChar(c)) {
|
|
13280
|
+
this.sectionStart = this.index;
|
|
13281
|
+
if (this.mode === 0) {
|
|
13282
|
+
this.state = 6;
|
|
13283
|
+
} else if (this.inSFCRoot) {
|
|
13284
|
+
this.state = 34;
|
|
13285
|
+
} else if (!this.inXML) {
|
|
13286
|
+
const lower = c | 32;
|
|
13287
|
+
if (lower === 116) {
|
|
13288
|
+
this.state = 30;
|
|
13289
|
+
} else {
|
|
13290
|
+
this.state = lower === 115 ? 29 : 6;
|
|
13291
|
+
}
|
|
13292
|
+
} else {
|
|
13293
|
+
this.state = 6;
|
|
13294
|
+
}
|
|
13295
|
+
} else if (c === 47) {
|
|
13296
|
+
this.state = 8;
|
|
13219
13297
|
} else {
|
|
13220
|
-
|
|
13298
|
+
this.state = 1;
|
|
13299
|
+
this.stateText(c);
|
|
13221
13300
|
}
|
|
13222
|
-
}
|
|
13223
|
-
|
|
13224
|
-
|
|
13301
|
+
}
|
|
13302
|
+
stateInTagName(c) {
|
|
13303
|
+
if (isEndOfTagSection(c)) {
|
|
13304
|
+
this.handleTagName(c);
|
|
13305
|
+
}
|
|
13306
|
+
}
|
|
13307
|
+
stateInSFCRootTagName(c) {
|
|
13308
|
+
if (isEndOfTagSection(c)) {
|
|
13309
|
+
const tag = this.buffer.slice(this.sectionStart, this.index);
|
|
13310
|
+
if (tag !== "template") {
|
|
13311
|
+
this.enterRCDATA(toCharCodes(`</` + tag), 0);
|
|
13312
|
+
}
|
|
13313
|
+
this.handleTagName(c);
|
|
13314
|
+
}
|
|
13315
|
+
}
|
|
13316
|
+
handleTagName(c) {
|
|
13317
|
+
this.cbs.onopentagname(this.sectionStart, this.index);
|
|
13318
|
+
this.sectionStart = -1;
|
|
13319
|
+
this.state = 11;
|
|
13320
|
+
this.stateBeforeAttrName(c);
|
|
13321
|
+
}
|
|
13322
|
+
stateBeforeClosingTagName(c) {
|
|
13323
|
+
if (isWhitespace(c)) ; else if (c === 62) {
|
|
13324
|
+
{
|
|
13325
|
+
this.cbs.onerr(14, this.index);
|
|
13326
|
+
}
|
|
13327
|
+
this.state = 1;
|
|
13328
|
+
this.sectionStart = this.index + 1;
|
|
13225
13329
|
} else {
|
|
13226
|
-
|
|
13330
|
+
this.state = isTagStartChar(c) ? 9 : 27;
|
|
13331
|
+
this.sectionStart = this.index;
|
|
13227
13332
|
}
|
|
13228
13333
|
}
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
);
|
|
13334
|
+
stateInClosingTagName(c) {
|
|
13335
|
+
if (c === 62 || isWhitespace(c)) {
|
|
13336
|
+
this.cbs.onclosetag(this.sectionStart, this.index);
|
|
13337
|
+
this.sectionStart = -1;
|
|
13338
|
+
this.state = 10;
|
|
13339
|
+
this.stateAfterClosingTagName(c);
|
|
13340
|
+
}
|
|
13237
13341
|
}
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
}
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13342
|
+
stateAfterClosingTagName(c) {
|
|
13343
|
+
if (c === 62) {
|
|
13344
|
+
this.state = 1;
|
|
13345
|
+
this.sectionStart = this.index + 1;
|
|
13346
|
+
}
|
|
13347
|
+
}
|
|
13348
|
+
stateBeforeAttrName(c) {
|
|
13349
|
+
if (c === 62) {
|
|
13350
|
+
this.cbs.onopentagend(this.index);
|
|
13351
|
+
if (this.inRCDATA) {
|
|
13352
|
+
this.state = 32;
|
|
13353
|
+
} else {
|
|
13354
|
+
this.state = 1;
|
|
13355
|
+
}
|
|
13356
|
+
this.sectionStart = this.index + 1;
|
|
13357
|
+
} else if (c === 47) {
|
|
13358
|
+
this.state = 7;
|
|
13359
|
+
if (this.peek() !== 62) {
|
|
13360
|
+
this.cbs.onerr(22, this.index);
|
|
13361
|
+
}
|
|
13362
|
+
} else if (c === 60 && this.peek() === 47) {
|
|
13363
|
+
this.cbs.onopentagend(this.index);
|
|
13364
|
+
this.state = 5;
|
|
13365
|
+
this.sectionStart = this.index;
|
|
13366
|
+
} else if (!isWhitespace(c)) {
|
|
13367
|
+
if (c === 61) {
|
|
13368
|
+
this.cbs.onerr(
|
|
13369
|
+
19,
|
|
13370
|
+
this.index
|
|
13371
|
+
);
|
|
13372
|
+
}
|
|
13373
|
+
this.handleAttrStart(c);
|
|
13374
|
+
}
|
|
13375
|
+
}
|
|
13376
|
+
handleAttrStart(c) {
|
|
13377
|
+
if (c === 118 && this.peek() === 45) {
|
|
13378
|
+
this.state = 13;
|
|
13379
|
+
this.sectionStart = this.index;
|
|
13380
|
+
} else if (c === 46 || c === 58 || c === 64 || c === 35) {
|
|
13381
|
+
this.cbs.ondirname(this.index, this.index + 1);
|
|
13382
|
+
this.state = 14;
|
|
13383
|
+
this.sectionStart = this.index + 1;
|
|
13384
|
+
} else {
|
|
13385
|
+
this.state = 12;
|
|
13386
|
+
this.sectionStart = this.index;
|
|
13387
|
+
}
|
|
13388
|
+
}
|
|
13389
|
+
stateInSelfClosingTag(c) {
|
|
13390
|
+
if (c === 62) {
|
|
13391
|
+
this.cbs.onselfclosingtag(this.index);
|
|
13392
|
+
this.state = 1;
|
|
13393
|
+
this.sectionStart = this.index + 1;
|
|
13394
|
+
this.inRCDATA = false;
|
|
13395
|
+
} else if (!isWhitespace(c)) {
|
|
13396
|
+
this.state = 11;
|
|
13397
|
+
this.stateBeforeAttrName(c);
|
|
13398
|
+
}
|
|
13399
|
+
}
|
|
13400
|
+
stateInAttrName(c) {
|
|
13401
|
+
if (c === 61 || isEndOfTagSection(c)) {
|
|
13402
|
+
this.cbs.onattribname(this.sectionStart, this.index);
|
|
13403
|
+
this.handleAttrNameEnd(c);
|
|
13404
|
+
} else if (c === 34 || c === 39 || c === 60) {
|
|
13405
|
+
this.cbs.onerr(
|
|
13406
|
+
17,
|
|
13407
|
+
this.index
|
|
13408
|
+
);
|
|
13409
|
+
}
|
|
13410
|
+
}
|
|
13411
|
+
stateInDirName(c) {
|
|
13412
|
+
if (c === 61 || isEndOfTagSection(c)) {
|
|
13413
|
+
this.cbs.ondirname(this.sectionStart, this.index);
|
|
13414
|
+
this.handleAttrNameEnd(c);
|
|
13415
|
+
} else if (c === 58) {
|
|
13416
|
+
this.cbs.ondirname(this.sectionStart, this.index);
|
|
13417
|
+
this.state = 14;
|
|
13418
|
+
this.sectionStart = this.index + 1;
|
|
13419
|
+
} else if (c === 46) {
|
|
13420
|
+
this.cbs.ondirname(this.sectionStart, this.index);
|
|
13421
|
+
this.state = 16;
|
|
13422
|
+
this.sectionStart = this.index + 1;
|
|
13423
|
+
}
|
|
13424
|
+
}
|
|
13425
|
+
stateInDirArg(c) {
|
|
13426
|
+
if (c === 61 || isEndOfTagSection(c)) {
|
|
13427
|
+
this.cbs.ondirarg(this.sectionStart, this.index);
|
|
13428
|
+
this.handleAttrNameEnd(c);
|
|
13429
|
+
} else if (c === 91) {
|
|
13430
|
+
this.state = 15;
|
|
13431
|
+
} else if (c === 46) {
|
|
13432
|
+
this.cbs.ondirarg(this.sectionStart, this.index);
|
|
13433
|
+
this.state = 16;
|
|
13434
|
+
this.sectionStart = this.index + 1;
|
|
13435
|
+
}
|
|
13436
|
+
}
|
|
13437
|
+
stateInDynamicDirArg(c) {
|
|
13438
|
+
if (c === 93) {
|
|
13439
|
+
this.state = 14;
|
|
13440
|
+
} else if (c === 61 || isEndOfTagSection(c)) {
|
|
13441
|
+
this.cbs.ondirarg(this.sectionStart, this.index + 1);
|
|
13442
|
+
this.handleAttrNameEnd(c);
|
|
13443
|
+
{
|
|
13444
|
+
this.cbs.onerr(
|
|
13445
|
+
27,
|
|
13446
|
+
this.index
|
|
13447
|
+
);
|
|
13448
|
+
}
|
|
13449
|
+
}
|
|
13450
|
+
}
|
|
13451
|
+
stateInDirModifier(c) {
|
|
13452
|
+
if (c === 61 || isEndOfTagSection(c)) {
|
|
13453
|
+
this.cbs.ondirmodifier(this.sectionStart, this.index);
|
|
13454
|
+
this.handleAttrNameEnd(c);
|
|
13455
|
+
} else if (c === 46) {
|
|
13456
|
+
this.cbs.ondirmodifier(this.sectionStart, this.index);
|
|
13457
|
+
this.sectionStart = this.index + 1;
|
|
13458
|
+
}
|
|
13459
|
+
}
|
|
13460
|
+
handleAttrNameEnd(c) {
|
|
13461
|
+
this.sectionStart = this.index;
|
|
13462
|
+
this.state = 17;
|
|
13463
|
+
this.cbs.onattribnameend(this.index);
|
|
13464
|
+
this.stateAfterAttrName(c);
|
|
13465
|
+
}
|
|
13466
|
+
stateAfterAttrName(c) {
|
|
13467
|
+
if (c === 61) {
|
|
13468
|
+
this.state = 18;
|
|
13469
|
+
} else if (c === 47 || c === 62) {
|
|
13470
|
+
this.cbs.onattribend(0, this.sectionStart);
|
|
13471
|
+
this.sectionStart = -1;
|
|
13472
|
+
this.state = 11;
|
|
13473
|
+
this.stateBeforeAttrName(c);
|
|
13474
|
+
} else if (!isWhitespace(c)) {
|
|
13475
|
+
this.cbs.onattribend(0, this.sectionStart);
|
|
13476
|
+
this.handleAttrStart(c);
|
|
13477
|
+
}
|
|
13478
|
+
}
|
|
13479
|
+
stateBeforeAttrValue(c) {
|
|
13480
|
+
if (c === 34) {
|
|
13481
|
+
this.state = 19;
|
|
13482
|
+
this.sectionStart = this.index + 1;
|
|
13483
|
+
} else if (c === 39) {
|
|
13484
|
+
this.state = 20;
|
|
13485
|
+
this.sectionStart = this.index + 1;
|
|
13486
|
+
} else if (!isWhitespace(c)) {
|
|
13487
|
+
this.sectionStart = this.index;
|
|
13488
|
+
this.state = 21;
|
|
13489
|
+
this.stateInAttrValueNoQuotes(c);
|
|
13490
|
+
}
|
|
13491
|
+
}
|
|
13492
|
+
handleInAttrValue(c, quote) {
|
|
13493
|
+
if (c === quote || this.fastForwardTo(quote)) {
|
|
13494
|
+
this.cbs.onattribdata(this.sectionStart, this.index);
|
|
13495
|
+
this.sectionStart = -1;
|
|
13496
|
+
this.cbs.onattribend(
|
|
13497
|
+
quote === 34 ? 3 : 2,
|
|
13498
|
+
this.index + 1
|
|
13499
|
+
);
|
|
13500
|
+
this.state = 11;
|
|
13501
|
+
}
|
|
13502
|
+
}
|
|
13503
|
+
stateInAttrValueDoubleQuotes(c) {
|
|
13504
|
+
this.handleInAttrValue(c, 34);
|
|
13505
|
+
}
|
|
13506
|
+
stateInAttrValueSingleQuotes(c) {
|
|
13507
|
+
this.handleInAttrValue(c, 39);
|
|
13508
|
+
}
|
|
13509
|
+
stateInAttrValueNoQuotes(c) {
|
|
13510
|
+
if (isWhitespace(c) || c === 62) {
|
|
13511
|
+
this.cbs.onattribdata(this.sectionStart, this.index);
|
|
13512
|
+
this.sectionStart = -1;
|
|
13513
|
+
this.cbs.onattribend(1, this.index);
|
|
13514
|
+
this.state = 11;
|
|
13515
|
+
this.stateBeforeAttrName(c);
|
|
13516
|
+
} else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) {
|
|
13517
|
+
this.cbs.onerr(
|
|
13518
|
+
18,
|
|
13519
|
+
this.index
|
|
13520
|
+
);
|
|
13521
|
+
} else ;
|
|
13522
|
+
}
|
|
13523
|
+
stateBeforeDeclaration(c) {
|
|
13524
|
+
if (c === 91) {
|
|
13525
|
+
this.state = 26;
|
|
13526
|
+
this.sequenceIndex = 0;
|
|
13527
|
+
} else {
|
|
13528
|
+
this.state = c === 45 ? 25 : 23;
|
|
13529
|
+
}
|
|
13530
|
+
}
|
|
13531
|
+
stateInDeclaration(c) {
|
|
13532
|
+
if (c === 62 || this.fastForwardTo(62)) {
|
|
13533
|
+
this.state = 1;
|
|
13534
|
+
this.sectionStart = this.index + 1;
|
|
13535
|
+
}
|
|
13536
|
+
}
|
|
13537
|
+
stateInProcessingInstruction(c) {
|
|
13538
|
+
if (c === 62 || this.fastForwardTo(62)) {
|
|
13539
|
+
this.cbs.onprocessinginstruction(this.sectionStart, this.index);
|
|
13540
|
+
this.state = 1;
|
|
13541
|
+
this.sectionStart = this.index + 1;
|
|
13542
|
+
}
|
|
13543
|
+
}
|
|
13544
|
+
stateBeforeComment(c) {
|
|
13545
|
+
if (c === 45) {
|
|
13546
|
+
this.state = 28;
|
|
13547
|
+
this.currentSequence = Sequences.CommentEnd;
|
|
13548
|
+
this.sequenceIndex = 2;
|
|
13549
|
+
this.sectionStart = this.index + 1;
|
|
13550
|
+
} else {
|
|
13551
|
+
this.state = 23;
|
|
13552
|
+
}
|
|
13553
|
+
}
|
|
13554
|
+
stateInSpecialComment(c) {
|
|
13555
|
+
if (c === 62 || this.fastForwardTo(62)) {
|
|
13556
|
+
this.cbs.oncomment(this.sectionStart, this.index);
|
|
13557
|
+
this.state = 1;
|
|
13558
|
+
this.sectionStart = this.index + 1;
|
|
13559
|
+
}
|
|
13560
|
+
}
|
|
13561
|
+
stateBeforeSpecialS(c) {
|
|
13562
|
+
const lower = c | 32;
|
|
13563
|
+
if (lower === Sequences.ScriptEnd[3]) {
|
|
13564
|
+
this.startSpecial(Sequences.ScriptEnd, 4);
|
|
13565
|
+
} else if (lower === Sequences.StyleEnd[3]) {
|
|
13566
|
+
this.startSpecial(Sequences.StyleEnd, 4);
|
|
13567
|
+
} else {
|
|
13568
|
+
this.state = 6;
|
|
13569
|
+
this.stateInTagName(c);
|
|
13570
|
+
}
|
|
13571
|
+
}
|
|
13572
|
+
stateBeforeSpecialT(c) {
|
|
13573
|
+
const lower = c | 32;
|
|
13574
|
+
if (lower === Sequences.TitleEnd[3]) {
|
|
13575
|
+
this.startSpecial(Sequences.TitleEnd, 4);
|
|
13576
|
+
} else if (lower === Sequences.TextareaEnd[3]) {
|
|
13577
|
+
this.startSpecial(Sequences.TextareaEnd, 4);
|
|
13578
|
+
} else {
|
|
13579
|
+
this.state = 6;
|
|
13580
|
+
this.stateInTagName(c);
|
|
13581
|
+
}
|
|
13582
|
+
}
|
|
13583
|
+
startEntity() {
|
|
13584
|
+
}
|
|
13585
|
+
stateInEntity() {
|
|
13586
|
+
}
|
|
13587
|
+
/**
|
|
13588
|
+
* Iterates through the buffer, calling the function corresponding to the current state.
|
|
13589
|
+
*
|
|
13590
|
+
* States that are more likely to be hit are higher up, as a performance improvement.
|
|
13591
|
+
*/
|
|
13592
|
+
parse(input) {
|
|
13593
|
+
this.buffer = input;
|
|
13594
|
+
while (this.index < this.buffer.length) {
|
|
13595
|
+
const c = this.buffer.charCodeAt(this.index);
|
|
13596
|
+
if (c === 10) {
|
|
13597
|
+
this.newlines.push(this.index);
|
|
13598
|
+
}
|
|
13599
|
+
switch (this.state) {
|
|
13600
|
+
case 1: {
|
|
13601
|
+
this.stateText(c);
|
|
13602
|
+
break;
|
|
13603
|
+
}
|
|
13604
|
+
case 2: {
|
|
13605
|
+
this.stateInterpolationOpen(c);
|
|
13606
|
+
break;
|
|
13607
|
+
}
|
|
13608
|
+
case 3: {
|
|
13609
|
+
this.stateInterpolation(c);
|
|
13610
|
+
break;
|
|
13611
|
+
}
|
|
13612
|
+
case 4: {
|
|
13613
|
+
this.stateInterpolationClose(c);
|
|
13614
|
+
break;
|
|
13615
|
+
}
|
|
13616
|
+
case 31: {
|
|
13617
|
+
this.stateSpecialStartSequence(c);
|
|
13618
|
+
break;
|
|
13619
|
+
}
|
|
13620
|
+
case 32: {
|
|
13621
|
+
this.stateInRCDATA(c);
|
|
13622
|
+
break;
|
|
13623
|
+
}
|
|
13624
|
+
case 26: {
|
|
13625
|
+
this.stateCDATASequence(c);
|
|
13626
|
+
break;
|
|
13627
|
+
}
|
|
13628
|
+
case 19: {
|
|
13629
|
+
this.stateInAttrValueDoubleQuotes(c);
|
|
13630
|
+
break;
|
|
13631
|
+
}
|
|
13632
|
+
case 12: {
|
|
13633
|
+
this.stateInAttrName(c);
|
|
13634
|
+
break;
|
|
13635
|
+
}
|
|
13636
|
+
case 13: {
|
|
13637
|
+
this.stateInDirName(c);
|
|
13638
|
+
break;
|
|
13639
|
+
}
|
|
13640
|
+
case 14: {
|
|
13641
|
+
this.stateInDirArg(c);
|
|
13642
|
+
break;
|
|
13643
|
+
}
|
|
13644
|
+
case 15: {
|
|
13645
|
+
this.stateInDynamicDirArg(c);
|
|
13646
|
+
break;
|
|
13647
|
+
}
|
|
13648
|
+
case 16: {
|
|
13649
|
+
this.stateInDirModifier(c);
|
|
13650
|
+
break;
|
|
13651
|
+
}
|
|
13652
|
+
case 28: {
|
|
13653
|
+
this.stateInCommentLike(c);
|
|
13654
|
+
break;
|
|
13655
|
+
}
|
|
13656
|
+
case 27: {
|
|
13657
|
+
this.stateInSpecialComment(c);
|
|
13658
|
+
break;
|
|
13659
|
+
}
|
|
13660
|
+
case 11: {
|
|
13661
|
+
this.stateBeforeAttrName(c);
|
|
13662
|
+
break;
|
|
13663
|
+
}
|
|
13664
|
+
case 6: {
|
|
13665
|
+
this.stateInTagName(c);
|
|
13666
|
+
break;
|
|
13667
|
+
}
|
|
13668
|
+
case 34: {
|
|
13669
|
+
this.stateInSFCRootTagName(c);
|
|
13670
|
+
break;
|
|
13671
|
+
}
|
|
13672
|
+
case 9: {
|
|
13673
|
+
this.stateInClosingTagName(c);
|
|
13674
|
+
break;
|
|
13675
|
+
}
|
|
13676
|
+
case 5: {
|
|
13677
|
+
this.stateBeforeTagName(c);
|
|
13678
|
+
break;
|
|
13679
|
+
}
|
|
13680
|
+
case 17: {
|
|
13681
|
+
this.stateAfterAttrName(c);
|
|
13682
|
+
break;
|
|
13683
|
+
}
|
|
13684
|
+
case 20: {
|
|
13685
|
+
this.stateInAttrValueSingleQuotes(c);
|
|
13686
|
+
break;
|
|
13687
|
+
}
|
|
13688
|
+
case 18: {
|
|
13689
|
+
this.stateBeforeAttrValue(c);
|
|
13690
|
+
break;
|
|
13691
|
+
}
|
|
13692
|
+
case 8: {
|
|
13693
|
+
this.stateBeforeClosingTagName(c);
|
|
13694
|
+
break;
|
|
13695
|
+
}
|
|
13696
|
+
case 10: {
|
|
13697
|
+
this.stateAfterClosingTagName(c);
|
|
13698
|
+
break;
|
|
13699
|
+
}
|
|
13700
|
+
case 29: {
|
|
13701
|
+
this.stateBeforeSpecialS(c);
|
|
13702
|
+
break;
|
|
13703
|
+
}
|
|
13704
|
+
case 30: {
|
|
13705
|
+
this.stateBeforeSpecialT(c);
|
|
13706
|
+
break;
|
|
13707
|
+
}
|
|
13708
|
+
case 21: {
|
|
13709
|
+
this.stateInAttrValueNoQuotes(c);
|
|
13710
|
+
break;
|
|
13711
|
+
}
|
|
13712
|
+
case 7: {
|
|
13713
|
+
this.stateInSelfClosingTag(c);
|
|
13714
|
+
break;
|
|
13715
|
+
}
|
|
13716
|
+
case 23: {
|
|
13717
|
+
this.stateInDeclaration(c);
|
|
13718
|
+
break;
|
|
13719
|
+
}
|
|
13720
|
+
case 22: {
|
|
13721
|
+
this.stateBeforeDeclaration(c);
|
|
13722
|
+
break;
|
|
13723
|
+
}
|
|
13724
|
+
case 25: {
|
|
13725
|
+
this.stateBeforeComment(c);
|
|
13726
|
+
break;
|
|
13727
|
+
}
|
|
13728
|
+
case 24: {
|
|
13729
|
+
this.stateInProcessingInstruction(c);
|
|
13730
|
+
break;
|
|
13731
|
+
}
|
|
13732
|
+
case 33: {
|
|
13733
|
+
this.stateInEntity();
|
|
13734
|
+
break;
|
|
13735
|
+
}
|
|
13736
|
+
}
|
|
13737
|
+
this.index++;
|
|
13738
|
+
}
|
|
13739
|
+
this.cleanup();
|
|
13740
|
+
this.finish();
|
|
13741
|
+
}
|
|
13742
|
+
/**
|
|
13743
|
+
* Remove data that has already been consumed from the buffer.
|
|
13744
|
+
*/
|
|
13745
|
+
cleanup() {
|
|
13746
|
+
if (this.sectionStart !== this.index) {
|
|
13747
|
+
if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) {
|
|
13748
|
+
this.cbs.ontext(this.sectionStart, this.index);
|
|
13749
|
+
this.sectionStart = this.index;
|
|
13750
|
+
} else if (this.state === 19 || this.state === 20 || this.state === 21) {
|
|
13751
|
+
this.cbs.onattribdata(this.sectionStart, this.index);
|
|
13752
|
+
this.sectionStart = this.index;
|
|
13753
|
+
}
|
|
13754
|
+
}
|
|
13755
|
+
}
|
|
13756
|
+
finish() {
|
|
13757
|
+
this.handleTrailingData();
|
|
13758
|
+
this.cbs.onend();
|
|
13759
|
+
}
|
|
13760
|
+
/** Handle any trailing data. */
|
|
13761
|
+
handleTrailingData() {
|
|
13762
|
+
const endIndex = this.buffer.length;
|
|
13763
|
+
if (this.sectionStart >= endIndex) {
|
|
13764
|
+
return;
|
|
13765
|
+
}
|
|
13766
|
+
if (this.state === 28) {
|
|
13767
|
+
if (this.currentSequence === Sequences.CdataEnd) {
|
|
13768
|
+
this.cbs.oncdata(this.sectionStart, endIndex);
|
|
13769
|
+
} else {
|
|
13770
|
+
this.cbs.oncomment(this.sectionStart, endIndex);
|
|
13771
|
+
}
|
|
13772
|
+
} else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else {
|
|
13773
|
+
this.cbs.ontext(this.sectionStart, endIndex);
|
|
13774
|
+
}
|
|
13775
|
+
}
|
|
13776
|
+
emitCodePoint(cp, consumed) {
|
|
13250
13777
|
}
|
|
13251
13778
|
}
|
|
13252
|
-
const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
|
|
13253
13779
|
|
|
13254
13780
|
const deprecationData = {
|
|
13255
13781
|
["COMPILER_IS_ON_ELEMENT"]: {
|
|
@@ -13260,9 +13786,6 @@ const deprecationData = {
|
|
|
13260
13786
|
message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`,
|
|
13261
13787
|
link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
|
|
13262
13788
|
},
|
|
13263
|
-
["COMPILER_V_BIND_PROP"]: {
|
|
13264
|
-
message: `.prop modifier for v-bind has been removed and no longer necessary. Vue 3 will automatically set a binding as DOM property when appropriate.`
|
|
13265
|
-
},
|
|
13266
13789
|
["COMPILER_V_BIND_OBJECT_ORDER"]: {
|
|
13267
13790
|
message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`,
|
|
13268
13791
|
link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`
|
|
@@ -13287,9 +13810,8 @@ const deprecationData = {
|
|
|
13287
13810
|
link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
|
|
13288
13811
|
}
|
|
13289
13812
|
};
|
|
13290
|
-
function getCompatValue(key,
|
|
13291
|
-
const
|
|
13292
|
-
const value = config && config[key];
|
|
13813
|
+
function getCompatValue(key, { compatConfig }) {
|
|
13814
|
+
const value = compatConfig && compatConfig[key];
|
|
13293
13815
|
if (key === "MODE") {
|
|
13294
13816
|
return value || 3;
|
|
13295
13817
|
} else {
|
|
@@ -13323,398 +13845,865 @@ function warnDeprecation(key, context, loc, ...args) {
|
|
|
13323
13845
|
context.onWarn(err);
|
|
13324
13846
|
}
|
|
13325
13847
|
|
|
13326
|
-
|
|
13327
|
-
|
|
13328
|
-
gt: ">",
|
|
13329
|
-
lt: "<",
|
|
13330
|
-
amp: "&",
|
|
13331
|
-
apos: "'",
|
|
13332
|
-
quot: '"'
|
|
13333
|
-
};
|
|
13334
|
-
const defaultParserOptions = {
|
|
13335
|
-
delimiters: [`{{`, `}}`],
|
|
13336
|
-
getNamespace: () => 0,
|
|
13337
|
-
getTextMode: () => 0,
|
|
13338
|
-
isVoidTag: NO,
|
|
13339
|
-
isPreTag: NO,
|
|
13340
|
-
isCustomElement: NO,
|
|
13341
|
-
decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),
|
|
13342
|
-
onError: defaultOnError,
|
|
13343
|
-
onWarn: defaultOnWarn,
|
|
13344
|
-
comments: true
|
|
13345
|
-
};
|
|
13346
|
-
function baseParse(content, options = {}) {
|
|
13347
|
-
const context = createParserContext(content, options);
|
|
13348
|
-
const start = getCursor(context);
|
|
13349
|
-
return createRoot(
|
|
13350
|
-
parseChildren(context, 0, []),
|
|
13351
|
-
getSelection(context, start)
|
|
13352
|
-
);
|
|
13353
|
-
}
|
|
13354
|
-
function createParserContext(content, rawOptions) {
|
|
13355
|
-
const options = extend({}, defaultParserOptions);
|
|
13356
|
-
let key;
|
|
13357
|
-
for (key in rawOptions) {
|
|
13358
|
-
options[key] = rawOptions[key] === void 0 ? defaultParserOptions[key] : rawOptions[key];
|
|
13359
|
-
}
|
|
13360
|
-
return {
|
|
13361
|
-
options,
|
|
13362
|
-
column: 1,
|
|
13363
|
-
line: 1,
|
|
13364
|
-
offset: 0,
|
|
13365
|
-
originalSource: content,
|
|
13366
|
-
source: content,
|
|
13367
|
-
inPre: false,
|
|
13368
|
-
inVPre: false,
|
|
13369
|
-
onWarn: options.onWarn
|
|
13370
|
-
};
|
|
13848
|
+
function defaultOnError(error) {
|
|
13849
|
+
throw error;
|
|
13371
13850
|
}
|
|
13372
|
-
function
|
|
13373
|
-
|
|
13374
|
-
const ns = parent ? parent.ns : 0;
|
|
13375
|
-
const nodes = [];
|
|
13376
|
-
while (!isEnd(context, mode, ancestors)) {
|
|
13377
|
-
const s = context.source;
|
|
13378
|
-
let node = void 0;
|
|
13379
|
-
if (mode === 0 || mode === 1) {
|
|
13380
|
-
if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
|
|
13381
|
-
node = parseInterpolation(context, mode);
|
|
13382
|
-
} else if (mode === 0 && s[0] === "<") {
|
|
13383
|
-
if (s.length === 1) {
|
|
13384
|
-
emitError(context, 5, 1);
|
|
13385
|
-
} else if (s[1] === "!") {
|
|
13386
|
-
if (startsWith(s, "<!--")) {
|
|
13387
|
-
node = parseComment(context);
|
|
13388
|
-
} else if (startsWith(s, "<!DOCTYPE")) {
|
|
13389
|
-
node = parseBogusComment(context);
|
|
13390
|
-
} else if (startsWith(s, "<![CDATA[")) {
|
|
13391
|
-
if (ns !== 0) {
|
|
13392
|
-
node = parseCDATA(context, ancestors);
|
|
13393
|
-
} else {
|
|
13394
|
-
emitError(context, 1);
|
|
13395
|
-
node = parseBogusComment(context);
|
|
13396
|
-
}
|
|
13397
|
-
} else {
|
|
13398
|
-
emitError(context, 11);
|
|
13399
|
-
node = parseBogusComment(context);
|
|
13400
|
-
}
|
|
13401
|
-
} else if (s[1] === "/") {
|
|
13402
|
-
if (s.length === 2) {
|
|
13403
|
-
emitError(context, 5, 2);
|
|
13404
|
-
} else if (s[2] === ">") {
|
|
13405
|
-
emitError(context, 14, 2);
|
|
13406
|
-
advanceBy(context, 3);
|
|
13407
|
-
continue;
|
|
13408
|
-
} else if (/[a-z]/i.test(s[2])) {
|
|
13409
|
-
emitError(context, 23);
|
|
13410
|
-
parseTag(context, 1 /* End */, parent);
|
|
13411
|
-
continue;
|
|
13412
|
-
} else {
|
|
13413
|
-
emitError(
|
|
13414
|
-
context,
|
|
13415
|
-
12,
|
|
13416
|
-
2
|
|
13417
|
-
);
|
|
13418
|
-
node = parseBogusComment(context);
|
|
13419
|
-
}
|
|
13420
|
-
} else if (/[a-z]/i.test(s[1])) {
|
|
13421
|
-
node = parseElement(context, ancestors);
|
|
13422
|
-
if (isCompatEnabled(
|
|
13423
|
-
"COMPILER_NATIVE_TEMPLATE",
|
|
13424
|
-
context
|
|
13425
|
-
) && node && node.tag === "template" && !node.props.some(
|
|
13426
|
-
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
13427
|
-
)) {
|
|
13428
|
-
warnDeprecation(
|
|
13429
|
-
"COMPILER_NATIVE_TEMPLATE",
|
|
13430
|
-
context,
|
|
13431
|
-
node.loc
|
|
13432
|
-
);
|
|
13433
|
-
node = node.children;
|
|
13434
|
-
}
|
|
13435
|
-
} else if (s[1] === "?") {
|
|
13436
|
-
emitError(
|
|
13437
|
-
context,
|
|
13438
|
-
21,
|
|
13439
|
-
1
|
|
13440
|
-
);
|
|
13441
|
-
node = parseBogusComment(context);
|
|
13442
|
-
} else {
|
|
13443
|
-
emitError(context, 12, 1);
|
|
13444
|
-
}
|
|
13445
|
-
}
|
|
13446
|
-
}
|
|
13447
|
-
if (!node) {
|
|
13448
|
-
node = parseText(context, mode);
|
|
13449
|
-
}
|
|
13450
|
-
if (isArray(node)) {
|
|
13451
|
-
for (let i = 0; i < node.length; i++) {
|
|
13452
|
-
pushNode(nodes, node[i]);
|
|
13453
|
-
}
|
|
13454
|
-
} else {
|
|
13455
|
-
pushNode(nodes, node);
|
|
13456
|
-
}
|
|
13457
|
-
}
|
|
13458
|
-
let removedWhitespace = false;
|
|
13459
|
-
if (mode !== 2 && mode !== 1) {
|
|
13460
|
-
const shouldCondense = context.options.whitespace !== "preserve";
|
|
13461
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
13462
|
-
const node = nodes[i];
|
|
13463
|
-
if (node.type === 2) {
|
|
13464
|
-
if (!context.inPre) {
|
|
13465
|
-
if (!/[^\t\r\n\f ]/.test(node.content)) {
|
|
13466
|
-
const prev = nodes[i - 1];
|
|
13467
|
-
const next = nodes[i + 1];
|
|
13468
|
-
if (!prev || !next || shouldCondense && (prev.type === 3 && next.type === 3 || prev.type === 3 && next.type === 1 || prev.type === 1 && next.type === 3 || prev.type === 1 && next.type === 1 && /[\r\n]/.test(node.content))) {
|
|
13469
|
-
removedWhitespace = true;
|
|
13470
|
-
nodes[i] = null;
|
|
13471
|
-
} else {
|
|
13472
|
-
node.content = " ";
|
|
13473
|
-
}
|
|
13474
|
-
} else if (shouldCondense) {
|
|
13475
|
-
node.content = node.content.replace(/[\t\r\n\f ]+/g, " ");
|
|
13476
|
-
}
|
|
13477
|
-
} else {
|
|
13478
|
-
node.content = node.content.replace(/\r\n/g, "\n");
|
|
13479
|
-
}
|
|
13480
|
-
} else if (node.type === 3 && !context.options.comments) {
|
|
13481
|
-
removedWhitespace = true;
|
|
13482
|
-
nodes[i] = null;
|
|
13483
|
-
}
|
|
13484
|
-
}
|
|
13485
|
-
if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
|
|
13486
|
-
const first = nodes[0];
|
|
13487
|
-
if (first && first.type === 2) {
|
|
13488
|
-
first.content = first.content.replace(/^\r?\n/, "");
|
|
13489
|
-
}
|
|
13490
|
-
}
|
|
13491
|
-
}
|
|
13492
|
-
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
13851
|
+
function defaultOnWarn(msg) {
|
|
13852
|
+
console.warn(`[Vue warn] ${msg.message}`);
|
|
13493
13853
|
}
|
|
13494
|
-
function
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
|
|
13499
|
-
|
|
13500
|
-
prev.loc.source += node.loc.source;
|
|
13501
|
-
return;
|
|
13502
|
-
}
|
|
13503
|
-
}
|
|
13504
|
-
nodes.push(node);
|
|
13854
|
+
function createCompilerError(code, loc, messages, additionalMessage) {
|
|
13855
|
+
const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ;
|
|
13856
|
+
const error = new SyntaxError(String(msg));
|
|
13857
|
+
error.code = code;
|
|
13858
|
+
error.loc = loc;
|
|
13859
|
+
return error;
|
|
13505
13860
|
}
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13522
|
-
|
|
13523
|
-
|
|
13861
|
+
const errorMessages = {
|
|
13862
|
+
// parse errors
|
|
13863
|
+
[0]: "Illegal comment.",
|
|
13864
|
+
[1]: "CDATA section is allowed only in XML context.",
|
|
13865
|
+
[2]: "Duplicate attribute.",
|
|
13866
|
+
[3]: "End tag cannot have attributes.",
|
|
13867
|
+
[4]: "Illegal '/' in tags.",
|
|
13868
|
+
[5]: "Unexpected EOF in tag.",
|
|
13869
|
+
[6]: "Unexpected EOF in CDATA section.",
|
|
13870
|
+
[7]: "Unexpected EOF in comment.",
|
|
13871
|
+
[8]: "Unexpected EOF in script.",
|
|
13872
|
+
[9]: "Unexpected EOF in tag.",
|
|
13873
|
+
[10]: "Incorrectly closed comment.",
|
|
13874
|
+
[11]: "Incorrectly opened comment.",
|
|
13875
|
+
[12]: "Illegal tag name. Use '<' to print '<'.",
|
|
13876
|
+
[13]: "Attribute value was expected.",
|
|
13877
|
+
[14]: "End tag name was expected.",
|
|
13878
|
+
[15]: "Whitespace was expected.",
|
|
13879
|
+
[16]: "Unexpected '<!--' in comment.",
|
|
13880
|
+
[17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
|
|
13881
|
+
[18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
|
|
13882
|
+
[19]: "Attribute name cannot start with '='.",
|
|
13883
|
+
[21]: "'<?' is allowed only in XML context.",
|
|
13884
|
+
[20]: `Unexpected null character.`,
|
|
13885
|
+
[22]: "Illegal '/' in tags.",
|
|
13886
|
+
// Vue-specific parse errors
|
|
13887
|
+
[23]: "Invalid end tag.",
|
|
13888
|
+
[24]: "Element is missing end tag.",
|
|
13889
|
+
[25]: "Interpolation end sign was not found.",
|
|
13890
|
+
[27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
|
|
13891
|
+
[26]: "Legal directive name was expected.",
|
|
13892
|
+
// transform errors
|
|
13893
|
+
[28]: `v-if/v-else-if is missing expression.`,
|
|
13894
|
+
[29]: `v-if/else branches must use unique keys.`,
|
|
13895
|
+
[30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
|
|
13896
|
+
[31]: `v-for is missing expression.`,
|
|
13897
|
+
[32]: `v-for has invalid expression.`,
|
|
13898
|
+
[33]: `<template v-for> key should be placed on the <template> tag.`,
|
|
13899
|
+
[34]: `v-bind is missing expression.`,
|
|
13900
|
+
[35]: `v-on is missing expression.`,
|
|
13901
|
+
[36]: `Unexpected custom directive on <slot> outlet.`,
|
|
13902
|
+
[37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
|
|
13903
|
+
[38]: `Duplicate slot names found. `,
|
|
13904
|
+
[39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
|
|
13905
|
+
[40]: `v-slot can only be used on components or <template> tags.`,
|
|
13906
|
+
[41]: `v-model is missing expression.`,
|
|
13907
|
+
[42]: `v-model value must be a valid JavaScript member expression.`,
|
|
13908
|
+
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
13909
|
+
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
13910
|
+
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
13911
|
+
[45]: `Error parsing JavaScript expression: `,
|
|
13912
|
+
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
13913
|
+
// generic errors
|
|
13914
|
+
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
13915
|
+
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
13916
|
+
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
13917
|
+
[50]: `"scopeId" option is only supported in module mode.`,
|
|
13918
|
+
// deprecations
|
|
13919
|
+
[51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
13920
|
+
[52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
|
|
13921
|
+
// just to fulfill types
|
|
13922
|
+
[53]: ``
|
|
13923
|
+
};
|
|
13924
|
+
|
|
13925
|
+
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
13926
|
+
function isCoreComponent(tag) {
|
|
13927
|
+
switch (tag) {
|
|
13928
|
+
case "Teleport":
|
|
13929
|
+
case "teleport":
|
|
13930
|
+
return TELEPORT;
|
|
13931
|
+
case "Suspense":
|
|
13932
|
+
case "suspense":
|
|
13933
|
+
return SUSPENSE;
|
|
13934
|
+
case "KeepAlive":
|
|
13935
|
+
case "keep-alive":
|
|
13936
|
+
return KEEP_ALIVE;
|
|
13937
|
+
case "BaseTransition":
|
|
13938
|
+
case "base-transition":
|
|
13939
|
+
return BASE_TRANSITION;
|
|
13940
|
+
}
|
|
13941
|
+
}
|
|
13942
|
+
const nonIdentifierRE = /^\d|[^\$\w]/;
|
|
13943
|
+
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
|
13944
|
+
const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
|
|
13945
|
+
const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
|
|
13946
|
+
const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
|
|
13947
|
+
const isMemberExpressionBrowser = (path) => {
|
|
13948
|
+
path = path.trim().replace(whitespaceRE, (s) => s.trim());
|
|
13949
|
+
let state = 0 /* inMemberExp */;
|
|
13950
|
+
let stateStack = [];
|
|
13951
|
+
let currentOpenBracketCount = 0;
|
|
13952
|
+
let currentOpenParensCount = 0;
|
|
13953
|
+
let currentStringType = null;
|
|
13954
|
+
for (let i = 0; i < path.length; i++) {
|
|
13955
|
+
const char = path.charAt(i);
|
|
13956
|
+
switch (state) {
|
|
13957
|
+
case 0 /* inMemberExp */:
|
|
13958
|
+
if (char === "[") {
|
|
13959
|
+
stateStack.push(state);
|
|
13960
|
+
state = 1 /* inBrackets */;
|
|
13961
|
+
currentOpenBracketCount++;
|
|
13962
|
+
} else if (char === "(") {
|
|
13963
|
+
stateStack.push(state);
|
|
13964
|
+
state = 2 /* inParens */;
|
|
13965
|
+
currentOpenParensCount++;
|
|
13966
|
+
} else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
|
|
13967
|
+
return false;
|
|
13968
|
+
}
|
|
13969
|
+
break;
|
|
13970
|
+
case 1 /* inBrackets */:
|
|
13971
|
+
if (char === `'` || char === `"` || char === "`") {
|
|
13972
|
+
stateStack.push(state);
|
|
13973
|
+
state = 3 /* inString */;
|
|
13974
|
+
currentStringType = char;
|
|
13975
|
+
} else if (char === `[`) {
|
|
13976
|
+
currentOpenBracketCount++;
|
|
13977
|
+
} else if (char === `]`) {
|
|
13978
|
+
if (!--currentOpenBracketCount) {
|
|
13979
|
+
state = stateStack.pop();
|
|
13980
|
+
}
|
|
13981
|
+
}
|
|
13982
|
+
break;
|
|
13983
|
+
case 2 /* inParens */:
|
|
13984
|
+
if (char === `'` || char === `"` || char === "`") {
|
|
13985
|
+
stateStack.push(state);
|
|
13986
|
+
state = 3 /* inString */;
|
|
13987
|
+
currentStringType = char;
|
|
13988
|
+
} else if (char === `(`) {
|
|
13989
|
+
currentOpenParensCount++;
|
|
13990
|
+
} else if (char === `)`) {
|
|
13991
|
+
if (i === path.length - 1) {
|
|
13992
|
+
return false;
|
|
13993
|
+
}
|
|
13994
|
+
if (!--currentOpenParensCount) {
|
|
13995
|
+
state = stateStack.pop();
|
|
13996
|
+
}
|
|
13997
|
+
}
|
|
13998
|
+
break;
|
|
13999
|
+
case 3 /* inString */:
|
|
14000
|
+
if (char === currentStringType) {
|
|
14001
|
+
state = stateStack.pop();
|
|
14002
|
+
currentStringType = null;
|
|
14003
|
+
}
|
|
14004
|
+
break;
|
|
14005
|
+
}
|
|
14006
|
+
}
|
|
14007
|
+
return !currentOpenBracketCount && !currentOpenParensCount;
|
|
14008
|
+
};
|
|
14009
|
+
const isMemberExpression = isMemberExpressionBrowser ;
|
|
14010
|
+
function assert(condition, msg) {
|
|
14011
|
+
if (!condition) {
|
|
14012
|
+
throw new Error(msg || `unexpected compiler condition`);
|
|
14013
|
+
}
|
|
14014
|
+
}
|
|
14015
|
+
function findDir(node, name, allowEmpty = false) {
|
|
14016
|
+
for (let i = 0; i < node.props.length; i++) {
|
|
14017
|
+
const p = node.props[i];
|
|
14018
|
+
if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
|
|
14019
|
+
return p;
|
|
14020
|
+
}
|
|
14021
|
+
}
|
|
14022
|
+
}
|
|
14023
|
+
function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
|
|
14024
|
+
for (let i = 0; i < node.props.length; i++) {
|
|
14025
|
+
const p = node.props[i];
|
|
14026
|
+
if (p.type === 6) {
|
|
14027
|
+
if (dynamicOnly)
|
|
14028
|
+
continue;
|
|
14029
|
+
if (p.name === name && (p.value || allowEmpty)) {
|
|
14030
|
+
return p;
|
|
14031
|
+
}
|
|
14032
|
+
} else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) {
|
|
14033
|
+
return p;
|
|
14034
|
+
}
|
|
14035
|
+
}
|
|
14036
|
+
}
|
|
14037
|
+
function isStaticArgOf(arg, name) {
|
|
14038
|
+
return !!(arg && isStaticExp(arg) && arg.content === name);
|
|
14039
|
+
}
|
|
14040
|
+
function hasDynamicKeyVBind(node) {
|
|
14041
|
+
return node.props.some(
|
|
14042
|
+
(p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
|
|
14043
|
+
p.arg.type !== 4 || // v-bind:[_ctx.foo]
|
|
14044
|
+
!p.arg.isStatic)
|
|
14045
|
+
// v-bind:[foo]
|
|
14046
|
+
);
|
|
14047
|
+
}
|
|
14048
|
+
function isText$1(node) {
|
|
14049
|
+
return node.type === 5 || node.type === 2;
|
|
14050
|
+
}
|
|
14051
|
+
function isVSlot(p) {
|
|
14052
|
+
return p.type === 7 && p.name === "slot";
|
|
14053
|
+
}
|
|
14054
|
+
function isTemplateNode(node) {
|
|
14055
|
+
return node.type === 1 && node.tagType === 3;
|
|
14056
|
+
}
|
|
14057
|
+
function isSlotOutlet(node) {
|
|
14058
|
+
return node.type === 1 && node.tagType === 2;
|
|
14059
|
+
}
|
|
14060
|
+
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
14061
|
+
function getUnnormalizedProps(props, callPath = []) {
|
|
14062
|
+
if (props && !isString(props) && props.type === 14) {
|
|
14063
|
+
const callee = props.callee;
|
|
14064
|
+
if (!isString(callee) && propsHelperSet.has(callee)) {
|
|
14065
|
+
return getUnnormalizedProps(
|
|
14066
|
+
props.arguments[0],
|
|
14067
|
+
callPath.concat(props)
|
|
14068
|
+
);
|
|
14069
|
+
}
|
|
14070
|
+
}
|
|
14071
|
+
return [props, callPath];
|
|
14072
|
+
}
|
|
14073
|
+
function injectProp(node, prop, context) {
|
|
14074
|
+
let propsWithInjection;
|
|
14075
|
+
let props = node.type === 13 ? node.props : node.arguments[2];
|
|
14076
|
+
let callPath = [];
|
|
14077
|
+
let parentCall;
|
|
14078
|
+
if (props && !isString(props) && props.type === 14) {
|
|
14079
|
+
const ret = getUnnormalizedProps(props);
|
|
14080
|
+
props = ret[0];
|
|
14081
|
+
callPath = ret[1];
|
|
14082
|
+
parentCall = callPath[callPath.length - 1];
|
|
14083
|
+
}
|
|
14084
|
+
if (props == null || isString(props)) {
|
|
14085
|
+
propsWithInjection = createObjectExpression([prop]);
|
|
14086
|
+
} else if (props.type === 14) {
|
|
14087
|
+
const first = props.arguments[0];
|
|
14088
|
+
if (!isString(first) && first.type === 15) {
|
|
14089
|
+
if (!hasProp(prop, first)) {
|
|
14090
|
+
first.properties.unshift(prop);
|
|
14091
|
+
}
|
|
14092
|
+
} else {
|
|
14093
|
+
if (props.callee === TO_HANDLERS) {
|
|
14094
|
+
propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
|
|
14095
|
+
createObjectExpression([prop]),
|
|
14096
|
+
props
|
|
14097
|
+
]);
|
|
14098
|
+
} else {
|
|
14099
|
+
props.arguments.unshift(createObjectExpression([prop]));
|
|
14100
|
+
}
|
|
14101
|
+
}
|
|
14102
|
+
!propsWithInjection && (propsWithInjection = props);
|
|
14103
|
+
} else if (props.type === 15) {
|
|
14104
|
+
if (!hasProp(prop, props)) {
|
|
14105
|
+
props.properties.unshift(prop);
|
|
14106
|
+
}
|
|
14107
|
+
propsWithInjection = props;
|
|
14108
|
+
} else {
|
|
14109
|
+
propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
|
|
14110
|
+
createObjectExpression([prop]),
|
|
14111
|
+
props
|
|
14112
|
+
]);
|
|
14113
|
+
if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {
|
|
14114
|
+
parentCall = callPath[callPath.length - 2];
|
|
14115
|
+
}
|
|
14116
|
+
}
|
|
14117
|
+
if (node.type === 13) {
|
|
14118
|
+
if (parentCall) {
|
|
14119
|
+
parentCall.arguments[0] = propsWithInjection;
|
|
14120
|
+
} else {
|
|
14121
|
+
node.props = propsWithInjection;
|
|
14122
|
+
}
|
|
14123
|
+
} else {
|
|
14124
|
+
if (parentCall) {
|
|
14125
|
+
parentCall.arguments[0] = propsWithInjection;
|
|
14126
|
+
} else {
|
|
14127
|
+
node.arguments[2] = propsWithInjection;
|
|
14128
|
+
}
|
|
14129
|
+
}
|
|
14130
|
+
}
|
|
14131
|
+
function hasProp(prop, props) {
|
|
14132
|
+
let result = false;
|
|
14133
|
+
if (prop.key.type === 4) {
|
|
14134
|
+
const propKeyName = prop.key.content;
|
|
14135
|
+
result = props.properties.some(
|
|
14136
|
+
(p) => p.key.type === 4 && p.key.content === propKeyName
|
|
14137
|
+
);
|
|
14138
|
+
}
|
|
14139
|
+
return result;
|
|
14140
|
+
}
|
|
14141
|
+
function toValidAssetId(name, type) {
|
|
14142
|
+
return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
|
|
14143
|
+
return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString();
|
|
14144
|
+
})}`;
|
|
14145
|
+
}
|
|
14146
|
+
function getMemoedVNodeCall(node) {
|
|
14147
|
+
if (node.type === 14 && node.callee === WITH_MEMO) {
|
|
14148
|
+
return node.arguments[1].returns;
|
|
13524
14149
|
} else {
|
|
13525
|
-
|
|
13526
|
-
|
|
14150
|
+
return node;
|
|
14151
|
+
}
|
|
14152
|
+
}
|
|
14153
|
+
const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
|
|
14154
|
+
|
|
14155
|
+
const defaultParserOptions = {
|
|
14156
|
+
parseMode: "base",
|
|
14157
|
+
ns: 0,
|
|
14158
|
+
delimiters: [`{{`, `}}`],
|
|
14159
|
+
getNamespace: () => 0,
|
|
14160
|
+
isVoidTag: NO,
|
|
14161
|
+
isPreTag: NO,
|
|
14162
|
+
isCustomElement: NO,
|
|
14163
|
+
onError: defaultOnError,
|
|
14164
|
+
onWarn: defaultOnWarn,
|
|
14165
|
+
comments: true
|
|
14166
|
+
};
|
|
14167
|
+
let currentOptions = defaultParserOptions;
|
|
14168
|
+
let currentRoot = null;
|
|
14169
|
+
let currentInput = "";
|
|
14170
|
+
let currentOpenTag = null;
|
|
14171
|
+
let currentProp = null;
|
|
14172
|
+
let currentAttrValue = "";
|
|
14173
|
+
let currentAttrStartIndex = -1;
|
|
14174
|
+
let currentAttrEndIndex = -1;
|
|
14175
|
+
let inPre = 0;
|
|
14176
|
+
let inVPre = false;
|
|
14177
|
+
let currentVPreBoundary = null;
|
|
14178
|
+
const stack = [];
|
|
14179
|
+
const tokenizer = new Tokenizer(stack, {
|
|
14180
|
+
onerr: emitError,
|
|
14181
|
+
ontext(start, end) {
|
|
14182
|
+
onText(getSlice(start, end), start, end);
|
|
14183
|
+
},
|
|
14184
|
+
ontextentity(char, start, end) {
|
|
14185
|
+
onText(char, start, end);
|
|
14186
|
+
},
|
|
14187
|
+
oninterpolation(start, end) {
|
|
14188
|
+
if (inVPre) {
|
|
14189
|
+
return onText(getSlice(start, end), start, end);
|
|
14190
|
+
}
|
|
14191
|
+
let innerStart = start + tokenizer.delimiterOpen.length;
|
|
14192
|
+
let innerEnd = end - tokenizer.delimiterClose.length;
|
|
14193
|
+
while (isWhitespace(currentInput.charCodeAt(innerStart))) {
|
|
14194
|
+
innerStart++;
|
|
14195
|
+
}
|
|
14196
|
+
while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) {
|
|
14197
|
+
innerEnd--;
|
|
14198
|
+
}
|
|
14199
|
+
let exp = getSlice(innerStart, innerEnd);
|
|
14200
|
+
if (exp.includes("&")) {
|
|
14201
|
+
{
|
|
14202
|
+
exp = currentOptions.decodeEntities(exp, false);
|
|
14203
|
+
}
|
|
14204
|
+
}
|
|
14205
|
+
addNode({
|
|
14206
|
+
type: 5,
|
|
14207
|
+
content: createSimpleExpression(exp, false, getLoc(innerStart, innerEnd)),
|
|
14208
|
+
loc: getLoc(start, end)
|
|
14209
|
+
});
|
|
14210
|
+
},
|
|
14211
|
+
onopentagname(start, end) {
|
|
14212
|
+
const name = getSlice(start, end);
|
|
14213
|
+
currentOpenTag = {
|
|
14214
|
+
type: 1,
|
|
14215
|
+
tag: name,
|
|
14216
|
+
ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns),
|
|
14217
|
+
tagType: 0,
|
|
14218
|
+
// will be refined on tag close
|
|
14219
|
+
props: [],
|
|
14220
|
+
children: [],
|
|
14221
|
+
loc: getLoc(start - 1, end),
|
|
14222
|
+
codegenNode: void 0
|
|
14223
|
+
};
|
|
14224
|
+
if (tokenizer.inSFCRoot) {
|
|
14225
|
+
currentOpenTag.innerLoc = getLoc(
|
|
14226
|
+
end + fastForward(end) + 1,
|
|
14227
|
+
end
|
|
14228
|
+
);
|
|
14229
|
+
}
|
|
14230
|
+
},
|
|
14231
|
+
onopentagend(end) {
|
|
14232
|
+
endOpenTag(end);
|
|
14233
|
+
},
|
|
14234
|
+
onclosetag(start, end) {
|
|
14235
|
+
const name = getSlice(start, end);
|
|
14236
|
+
if (!currentOptions.isVoidTag(name)) {
|
|
14237
|
+
let found = false;
|
|
14238
|
+
for (let i = 0; i < stack.length; i++) {
|
|
14239
|
+
const e = stack[i];
|
|
14240
|
+
if (e.tag.toLowerCase() === name.toLowerCase()) {
|
|
14241
|
+
found = true;
|
|
14242
|
+
if (i > 0) {
|
|
14243
|
+
emitError(24, stack[0].loc.start.offset);
|
|
14244
|
+
}
|
|
14245
|
+
for (let j = 0; j <= i; j++) {
|
|
14246
|
+
const el = stack.shift();
|
|
14247
|
+
onCloseTag(el, end, j < i);
|
|
14248
|
+
}
|
|
14249
|
+
break;
|
|
14250
|
+
}
|
|
14251
|
+
}
|
|
14252
|
+
if (!found) {
|
|
14253
|
+
emitError(23, backTrack(start, 60));
|
|
14254
|
+
}
|
|
14255
|
+
}
|
|
14256
|
+
},
|
|
14257
|
+
onselfclosingtag(end) {
|
|
14258
|
+
var _a;
|
|
14259
|
+
const name = currentOpenTag.tag;
|
|
14260
|
+
currentOpenTag.isSelfClosing = true;
|
|
14261
|
+
endOpenTag(end);
|
|
14262
|
+
if (((_a = stack[0]) == null ? void 0 : _a.tag) === name) {
|
|
14263
|
+
onCloseTag(stack.shift(), end);
|
|
14264
|
+
}
|
|
14265
|
+
},
|
|
14266
|
+
onattribname(start, end) {
|
|
14267
|
+
currentProp = {
|
|
14268
|
+
type: 6,
|
|
14269
|
+
name: getSlice(start, end),
|
|
14270
|
+
nameLoc: getLoc(start, end),
|
|
14271
|
+
value: void 0,
|
|
14272
|
+
loc: getLoc(start)
|
|
14273
|
+
};
|
|
14274
|
+
},
|
|
14275
|
+
ondirname(start, end) {
|
|
14276
|
+
const raw = getSlice(start, end);
|
|
14277
|
+
const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2);
|
|
14278
|
+
if (!inVPre && name === "") {
|
|
14279
|
+
emitError(26, start);
|
|
14280
|
+
}
|
|
14281
|
+
if (inVPre || name === "") {
|
|
14282
|
+
currentProp = {
|
|
14283
|
+
type: 6,
|
|
14284
|
+
name: raw,
|
|
14285
|
+
nameLoc: getLoc(start, end),
|
|
14286
|
+
value: void 0,
|
|
14287
|
+
loc: getLoc(start)
|
|
14288
|
+
};
|
|
14289
|
+
} else {
|
|
14290
|
+
currentProp = {
|
|
14291
|
+
type: 7,
|
|
14292
|
+
name,
|
|
14293
|
+
rawName: raw,
|
|
14294
|
+
exp: void 0,
|
|
14295
|
+
arg: void 0,
|
|
14296
|
+
modifiers: raw === "." ? ["prop"] : [],
|
|
14297
|
+
loc: getLoc(start)
|
|
14298
|
+
};
|
|
14299
|
+
if (name === "pre") {
|
|
14300
|
+
inVPre = true;
|
|
14301
|
+
currentVPreBoundary = currentOpenTag;
|
|
14302
|
+
const props = currentOpenTag.props;
|
|
14303
|
+
for (let i = 0; i < props.length; i++) {
|
|
14304
|
+
if (props[i].type === 7) {
|
|
14305
|
+
props[i] = dirToAttr(props[i]);
|
|
14306
|
+
}
|
|
14307
|
+
}
|
|
14308
|
+
}
|
|
14309
|
+
}
|
|
14310
|
+
},
|
|
14311
|
+
ondirarg(start, end) {
|
|
14312
|
+
const arg = getSlice(start, end);
|
|
14313
|
+
if (inVPre) {
|
|
14314
|
+
currentProp.name += arg;
|
|
14315
|
+
setLocEnd(currentProp.nameLoc, end);
|
|
14316
|
+
} else {
|
|
14317
|
+
const isStatic = arg[0] !== `[`;
|
|
14318
|
+
currentProp.arg = createSimpleExpression(
|
|
14319
|
+
isStatic ? arg : arg.slice(1, -1),
|
|
14320
|
+
isStatic,
|
|
14321
|
+
getLoc(start, end),
|
|
14322
|
+
isStatic ? 3 : 0
|
|
14323
|
+
);
|
|
14324
|
+
}
|
|
14325
|
+
},
|
|
14326
|
+
ondirmodifier(start, end) {
|
|
14327
|
+
const mod = getSlice(start, end);
|
|
14328
|
+
if (inVPre) {
|
|
14329
|
+
currentProp.name += "." + mod;
|
|
14330
|
+
setLocEnd(currentProp.nameLoc, end);
|
|
14331
|
+
} else if (currentProp.name === "slot") {
|
|
14332
|
+
const arg = currentProp.arg;
|
|
14333
|
+
if (arg) {
|
|
14334
|
+
arg.content += "." + mod;
|
|
14335
|
+
setLocEnd(arg.loc, end);
|
|
14336
|
+
}
|
|
14337
|
+
} else {
|
|
14338
|
+
currentProp.modifiers.push(mod);
|
|
14339
|
+
}
|
|
14340
|
+
},
|
|
14341
|
+
onattribdata(start, end) {
|
|
14342
|
+
currentAttrValue += getSlice(start, end);
|
|
14343
|
+
if (currentAttrStartIndex < 0)
|
|
14344
|
+
currentAttrStartIndex = start;
|
|
14345
|
+
currentAttrEndIndex = end;
|
|
14346
|
+
},
|
|
14347
|
+
onattribentity(char, start, end) {
|
|
14348
|
+
currentAttrValue += char;
|
|
14349
|
+
if (currentAttrStartIndex < 0)
|
|
14350
|
+
currentAttrStartIndex = start;
|
|
14351
|
+
currentAttrEndIndex = end;
|
|
14352
|
+
},
|
|
14353
|
+
onattribnameend(end) {
|
|
14354
|
+
const start = currentProp.loc.start.offset;
|
|
14355
|
+
const name = getSlice(start, end);
|
|
14356
|
+
if (currentProp.type === 7) {
|
|
14357
|
+
currentProp.rawName = name;
|
|
14358
|
+
}
|
|
14359
|
+
if (currentOpenTag.props.some(
|
|
14360
|
+
(p) => (p.type === 7 ? p.rawName : p.name) === name
|
|
14361
|
+
)) {
|
|
14362
|
+
emitError(2, start);
|
|
14363
|
+
}
|
|
14364
|
+
},
|
|
14365
|
+
onattribend(quote, end) {
|
|
14366
|
+
if (currentOpenTag && currentProp) {
|
|
14367
|
+
setLocEnd(currentProp.loc, end);
|
|
14368
|
+
if (quote !== 0) {
|
|
14369
|
+
if (currentAttrValue.includes("&")) {
|
|
14370
|
+
currentAttrValue = currentOptions.decodeEntities(
|
|
14371
|
+
currentAttrValue,
|
|
14372
|
+
true
|
|
14373
|
+
);
|
|
14374
|
+
}
|
|
14375
|
+
if (currentProp.type === 6) {
|
|
14376
|
+
if (currentProp.name === "class") {
|
|
14377
|
+
currentAttrValue = condense(currentAttrValue).trim();
|
|
14378
|
+
}
|
|
14379
|
+
if (quote === 1 && !currentAttrValue) {
|
|
14380
|
+
emitError(13, end);
|
|
14381
|
+
}
|
|
14382
|
+
currentProp.value = {
|
|
14383
|
+
type: 2,
|
|
14384
|
+
content: currentAttrValue,
|
|
14385
|
+
loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1)
|
|
14386
|
+
};
|
|
14387
|
+
if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") {
|
|
14388
|
+
tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
|
|
14389
|
+
}
|
|
14390
|
+
} else {
|
|
14391
|
+
currentProp.exp = createSimpleExpression(
|
|
14392
|
+
currentAttrValue,
|
|
14393
|
+
false,
|
|
14394
|
+
getLoc(currentAttrStartIndex, currentAttrEndIndex)
|
|
14395
|
+
);
|
|
14396
|
+
if (currentProp.name === "for") {
|
|
14397
|
+
currentProp.forParseResult = parseForExpression(currentProp.exp);
|
|
14398
|
+
}
|
|
14399
|
+
let syncIndex = -1;
|
|
14400
|
+
if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.indexOf("sync")) > -1 && checkCompatEnabled(
|
|
14401
|
+
"COMPILER_V_BIND_SYNC",
|
|
14402
|
+
currentOptions,
|
|
14403
|
+
currentProp.loc,
|
|
14404
|
+
currentProp.rawName
|
|
14405
|
+
)) {
|
|
14406
|
+
currentProp.name = "model";
|
|
14407
|
+
currentProp.modifiers.splice(syncIndex, 1);
|
|
14408
|
+
}
|
|
14409
|
+
}
|
|
14410
|
+
}
|
|
14411
|
+
if (currentProp.type !== 7 || currentProp.name !== "pre") {
|
|
14412
|
+
currentOpenTag.props.push(currentProp);
|
|
14413
|
+
}
|
|
13527
14414
|
}
|
|
13528
|
-
|
|
13529
|
-
|
|
14415
|
+
currentAttrValue = "";
|
|
14416
|
+
currentAttrStartIndex = currentAttrEndIndex = -1;
|
|
14417
|
+
},
|
|
14418
|
+
oncomment(start, end) {
|
|
14419
|
+
if (currentOptions.comments) {
|
|
14420
|
+
addNode({
|
|
14421
|
+
type: 3,
|
|
14422
|
+
content: getSlice(start, end),
|
|
14423
|
+
loc: getLoc(start - 4, end + 3)
|
|
14424
|
+
});
|
|
13530
14425
|
}
|
|
13531
|
-
|
|
13532
|
-
|
|
13533
|
-
|
|
13534
|
-
|
|
13535
|
-
|
|
13536
|
-
|
|
13537
|
-
|
|
14426
|
+
},
|
|
14427
|
+
onend() {
|
|
14428
|
+
const end = currentInput.length;
|
|
14429
|
+
if (tokenizer.state !== 1) {
|
|
14430
|
+
switch (tokenizer.state) {
|
|
14431
|
+
case 5:
|
|
14432
|
+
case 8:
|
|
14433
|
+
emitError(5, end);
|
|
14434
|
+
break;
|
|
14435
|
+
case 3:
|
|
14436
|
+
case 4:
|
|
14437
|
+
emitError(
|
|
14438
|
+
25,
|
|
14439
|
+
tokenizer.sectionStart
|
|
14440
|
+
);
|
|
14441
|
+
break;
|
|
14442
|
+
case 28:
|
|
14443
|
+
if (tokenizer.currentSequence === Sequences.CdataEnd) {
|
|
14444
|
+
emitError(6, end);
|
|
14445
|
+
} else {
|
|
14446
|
+
emitError(7, end);
|
|
14447
|
+
}
|
|
14448
|
+
break;
|
|
14449
|
+
case 6:
|
|
14450
|
+
case 7:
|
|
14451
|
+
case 9:
|
|
14452
|
+
case 11:
|
|
14453
|
+
case 12:
|
|
14454
|
+
case 13:
|
|
14455
|
+
case 14:
|
|
14456
|
+
case 15:
|
|
14457
|
+
case 16:
|
|
14458
|
+
case 17:
|
|
14459
|
+
case 18:
|
|
14460
|
+
case 19:
|
|
14461
|
+
case 20:
|
|
14462
|
+
case 21:
|
|
14463
|
+
emitError(9, end);
|
|
14464
|
+
break;
|
|
13538
14465
|
}
|
|
13539
|
-
prevIndex = nestedIndex + 1;
|
|
13540
14466
|
}
|
|
13541
|
-
|
|
14467
|
+
for (let index = 0; index < stack.length; index++) {
|
|
14468
|
+
onCloseTag(stack[index], end - 1);
|
|
14469
|
+
emitError(24, stack[index].loc.start.offset);
|
|
14470
|
+
}
|
|
14471
|
+
},
|
|
14472
|
+
oncdata(start, end) {
|
|
14473
|
+
if (stack[0].ns !== 0) {
|
|
14474
|
+
onText(getSlice(start, end), start, end);
|
|
14475
|
+
} else {
|
|
14476
|
+
emitError(1, start - 9);
|
|
14477
|
+
}
|
|
14478
|
+
},
|
|
14479
|
+
onprocessinginstruction(start) {
|
|
14480
|
+
if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
|
|
14481
|
+
emitError(
|
|
14482
|
+
21,
|
|
14483
|
+
start - 1
|
|
14484
|
+
);
|
|
14485
|
+
}
|
|
13542
14486
|
}
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
14487
|
+
});
|
|
14488
|
+
const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
|
|
14489
|
+
const stripParensRE = /^\(|\)$/g;
|
|
14490
|
+
function parseForExpression(input) {
|
|
14491
|
+
const loc = input.loc;
|
|
14492
|
+
const exp = input.content;
|
|
14493
|
+
const inMatch = exp.match(forAliasRE);
|
|
14494
|
+
if (!inMatch)
|
|
14495
|
+
return;
|
|
14496
|
+
const [, LHS, RHS] = inMatch;
|
|
14497
|
+
const createAliasExpression = (content, offset) => {
|
|
14498
|
+
const start = loc.start.offset + offset;
|
|
14499
|
+
const end = start + content.length;
|
|
14500
|
+
return createSimpleExpression(content, false, getLoc(start, end));
|
|
13547
14501
|
};
|
|
14502
|
+
const result = {
|
|
14503
|
+
source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
|
|
14504
|
+
value: void 0,
|
|
14505
|
+
key: void 0,
|
|
14506
|
+
index: void 0,
|
|
14507
|
+
finalized: false
|
|
14508
|
+
};
|
|
14509
|
+
let valueContent = LHS.trim().replace(stripParensRE, "").trim();
|
|
14510
|
+
const trimmedOffset = LHS.indexOf(valueContent);
|
|
14511
|
+
const iteratorMatch = valueContent.match(forIteratorRE);
|
|
14512
|
+
if (iteratorMatch) {
|
|
14513
|
+
valueContent = valueContent.replace(forIteratorRE, "").trim();
|
|
14514
|
+
const keyContent = iteratorMatch[1].trim();
|
|
14515
|
+
let keyOffset;
|
|
14516
|
+
if (keyContent) {
|
|
14517
|
+
keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
|
|
14518
|
+
result.key = createAliasExpression(keyContent, keyOffset);
|
|
14519
|
+
}
|
|
14520
|
+
if (iteratorMatch[2]) {
|
|
14521
|
+
const indexContent = iteratorMatch[2].trim();
|
|
14522
|
+
if (indexContent) {
|
|
14523
|
+
result.index = createAliasExpression(
|
|
14524
|
+
indexContent,
|
|
14525
|
+
exp.indexOf(
|
|
14526
|
+
indexContent,
|
|
14527
|
+
result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
|
|
14528
|
+
)
|
|
14529
|
+
);
|
|
14530
|
+
}
|
|
14531
|
+
}
|
|
14532
|
+
}
|
|
14533
|
+
if (valueContent) {
|
|
14534
|
+
result.value = createAliasExpression(valueContent, trimmedOffset);
|
|
14535
|
+
}
|
|
14536
|
+
return result;
|
|
14537
|
+
}
|
|
14538
|
+
function getSlice(start, end) {
|
|
14539
|
+
return currentInput.slice(start, end);
|
|
13548
14540
|
}
|
|
13549
|
-
function
|
|
13550
|
-
|
|
13551
|
-
const
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
14541
|
+
function endOpenTag(end) {
|
|
14542
|
+
addNode(currentOpenTag);
|
|
14543
|
+
const { tag, ns } = currentOpenTag;
|
|
14544
|
+
if (ns === 0 && currentOptions.isPreTag(tag)) {
|
|
14545
|
+
inPre++;
|
|
14546
|
+
}
|
|
14547
|
+
if (currentOptions.isVoidTag(tag)) {
|
|
14548
|
+
onCloseTag(currentOpenTag, end);
|
|
13557
14549
|
} else {
|
|
13558
|
-
|
|
13559
|
-
|
|
14550
|
+
stack.unshift(currentOpenTag);
|
|
14551
|
+
if (ns === 1 || ns === 2) {
|
|
14552
|
+
tokenizer.inXML = true;
|
|
14553
|
+
}
|
|
13560
14554
|
}
|
|
13561
|
-
|
|
13562
|
-
type: 3,
|
|
13563
|
-
content,
|
|
13564
|
-
loc: getSelection(context, start)
|
|
13565
|
-
};
|
|
14555
|
+
currentOpenTag = null;
|
|
13566
14556
|
}
|
|
13567
|
-
function
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
14557
|
+
function onText(content, start, end) {
|
|
14558
|
+
var _a;
|
|
14559
|
+
{
|
|
14560
|
+
const tag = (_a = stack[0]) == null ? void 0 : _a.tag;
|
|
14561
|
+
if (tag !== "script" && tag !== "style" && content.includes("&")) {
|
|
14562
|
+
content = currentOptions.decodeEntities(content, false);
|
|
14563
|
+
}
|
|
14564
|
+
}
|
|
14565
|
+
const parent = stack[0] || currentRoot;
|
|
14566
|
+
const lastNode = parent.children[parent.children.length - 1];
|
|
14567
|
+
if ((lastNode == null ? void 0 : lastNode.type) === 2) {
|
|
14568
|
+
lastNode.content += content;
|
|
14569
|
+
setLocEnd(lastNode.loc, end);
|
|
14570
|
+
} else {
|
|
14571
|
+
parent.children.push({
|
|
14572
|
+
type: 2,
|
|
14573
|
+
content,
|
|
14574
|
+
loc: getLoc(start, end)
|
|
14575
|
+
});
|
|
14576
|
+
}
|
|
14577
|
+
}
|
|
14578
|
+
function onCloseTag(el, end, isImplied = false) {
|
|
14579
|
+
if (isImplied) {
|
|
14580
|
+
setLocEnd(el.loc, backTrack(end, 60));
|
|
14581
|
+
} else {
|
|
14582
|
+
setLocEnd(el.loc, end + fastForward(end) + 1);
|
|
14583
|
+
}
|
|
14584
|
+
if (tokenizer.inSFCRoot) {
|
|
14585
|
+
if (el.children.length) {
|
|
14586
|
+
el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end);
|
|
14587
|
+
} else {
|
|
14588
|
+
el.innerLoc.end = extend({}, el.innerLoc.start);
|
|
14589
|
+
}
|
|
14590
|
+
el.innerLoc.source = getSlice(
|
|
14591
|
+
el.innerLoc.start.offset,
|
|
14592
|
+
el.innerLoc.end.offset
|
|
14593
|
+
);
|
|
14594
|
+
}
|
|
14595
|
+
const { tag, ns } = el;
|
|
14596
|
+
if (!inVPre) {
|
|
14597
|
+
if (tag === "slot") {
|
|
14598
|
+
el.tagType = 2;
|
|
14599
|
+
} else if (isFragmentTemplate(el)) {
|
|
14600
|
+
el.tagType = 3;
|
|
14601
|
+
} else if (isComponent(el)) {
|
|
14602
|
+
el.tagType = 1;
|
|
14603
|
+
}
|
|
14604
|
+
}
|
|
14605
|
+
if (!tokenizer.inRCDATA) {
|
|
14606
|
+
el.children = condenseWhitespace(el.children, el.tag);
|
|
14607
|
+
}
|
|
14608
|
+
if (ns === 0 && currentOptions.isPreTag(tag)) {
|
|
14609
|
+
inPre--;
|
|
14610
|
+
}
|
|
14611
|
+
if (currentVPreBoundary === el) {
|
|
14612
|
+
inVPre = false;
|
|
14613
|
+
currentVPreBoundary = null;
|
|
14614
|
+
}
|
|
14615
|
+
if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
|
|
14616
|
+
tokenizer.inXML = false;
|
|
14617
|
+
}
|
|
13587
14618
|
{
|
|
13588
|
-
const
|
|
14619
|
+
const props = el.props;
|
|
14620
|
+
if (isCompatEnabled(
|
|
14621
|
+
"COMPILER_V_IF_V_FOR_PRECEDENCE",
|
|
14622
|
+
currentOptions
|
|
14623
|
+
)) {
|
|
14624
|
+
let hasIf = false;
|
|
14625
|
+
let hasFor = false;
|
|
14626
|
+
for (let i = 0; i < props.length; i++) {
|
|
14627
|
+
const p = props[i];
|
|
14628
|
+
if (p.type === 7) {
|
|
14629
|
+
if (p.name === "if") {
|
|
14630
|
+
hasIf = true;
|
|
14631
|
+
} else if (p.name === "for") {
|
|
14632
|
+
hasFor = true;
|
|
14633
|
+
}
|
|
14634
|
+
}
|
|
14635
|
+
if (hasIf && hasFor) {
|
|
14636
|
+
warnDeprecation(
|
|
14637
|
+
"COMPILER_V_IF_V_FOR_PRECEDENCE",
|
|
14638
|
+
currentOptions,
|
|
14639
|
+
el.loc
|
|
14640
|
+
);
|
|
14641
|
+
break;
|
|
14642
|
+
}
|
|
14643
|
+
}
|
|
14644
|
+
}
|
|
14645
|
+
if (isCompatEnabled(
|
|
14646
|
+
"COMPILER_NATIVE_TEMPLATE",
|
|
14647
|
+
currentOptions
|
|
14648
|
+
) && el.tag === "template" && !isFragmentTemplate(el)) {
|
|
14649
|
+
warnDeprecation(
|
|
14650
|
+
"COMPILER_NATIVE_TEMPLATE",
|
|
14651
|
+
currentOptions,
|
|
14652
|
+
el.loc
|
|
14653
|
+
);
|
|
14654
|
+
const parent = stack[0] || currentRoot;
|
|
14655
|
+
const index = parent.children.indexOf(el);
|
|
14656
|
+
parent.children.splice(index, 1, ...el.children);
|
|
14657
|
+
}
|
|
14658
|
+
const inlineTemplateProp = props.find(
|
|
13589
14659
|
(p) => p.type === 6 && p.name === "inline-template"
|
|
13590
14660
|
);
|
|
13591
14661
|
if (inlineTemplateProp && checkCompatEnabled(
|
|
13592
14662
|
"COMPILER_INLINE_TEMPLATE",
|
|
13593
|
-
|
|
14663
|
+
currentOptions,
|
|
13594
14664
|
inlineTemplateProp.loc
|
|
13595
|
-
)) {
|
|
13596
|
-
const loc = getSelection(context, element.loc.end);
|
|
14665
|
+
) && el.children.length) {
|
|
13597
14666
|
inlineTemplateProp.value = {
|
|
13598
14667
|
type: 2,
|
|
13599
|
-
content:
|
|
13600
|
-
|
|
13601
|
-
|
|
13602
|
-
|
|
13603
|
-
|
|
13604
|
-
|
|
13605
|
-
if (startsWithEndTagOpen(context.source, element.tag)) {
|
|
13606
|
-
parseTag(context, 1 /* End */, parent);
|
|
13607
|
-
} else {
|
|
13608
|
-
emitError(context, 24, 0, element.loc.start);
|
|
13609
|
-
if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
|
|
13610
|
-
const first = children[0];
|
|
13611
|
-
if (first && startsWith(first.loc.source, "<!--")) {
|
|
13612
|
-
emitError(context, 8);
|
|
13613
|
-
}
|
|
14668
|
+
content: getSlice(
|
|
14669
|
+
el.children[0].loc.start.offset,
|
|
14670
|
+
el.children[el.children.length - 1].loc.end.offset
|
|
14671
|
+
),
|
|
14672
|
+
loc: inlineTemplateProp.loc
|
|
14673
|
+
};
|
|
13614
14674
|
}
|
|
13615
14675
|
}
|
|
13616
|
-
element.loc = getSelection(context, element.loc.start);
|
|
13617
|
-
if (isPreBoundary) {
|
|
13618
|
-
context.inPre = false;
|
|
13619
|
-
}
|
|
13620
|
-
if (isVPreBoundary) {
|
|
13621
|
-
context.inVPre = false;
|
|
13622
|
-
}
|
|
13623
|
-
return element;
|
|
13624
14676
|
}
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
)
|
|
13628
|
-
|
|
13629
|
-
const start = getCursor(context);
|
|
13630
|
-
const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
|
|
13631
|
-
const tag = match[1];
|
|
13632
|
-
const ns = context.options.getNamespace(tag, parent);
|
|
13633
|
-
advanceBy(context, match[0].length);
|
|
13634
|
-
advanceSpaces(context);
|
|
13635
|
-
const cursor = getCursor(context);
|
|
13636
|
-
const currentSource = context.source;
|
|
13637
|
-
if (context.options.isPreTag(tag)) {
|
|
13638
|
-
context.inPre = true;
|
|
13639
|
-
}
|
|
13640
|
-
let props = parseAttributes(context, type);
|
|
13641
|
-
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
|
|
13642
|
-
context.inVPre = true;
|
|
13643
|
-
extend(context, cursor);
|
|
13644
|
-
context.source = currentSource;
|
|
13645
|
-
props = parseAttributes(context, type).filter((p) => p.name !== "v-pre");
|
|
13646
|
-
}
|
|
13647
|
-
let isSelfClosing = false;
|
|
13648
|
-
if (context.source.length === 0) {
|
|
13649
|
-
emitError(context, 9);
|
|
13650
|
-
} else {
|
|
13651
|
-
isSelfClosing = startsWith(context.source, "/>");
|
|
13652
|
-
if (type === 1 /* End */ && isSelfClosing) {
|
|
13653
|
-
emitError(context, 4);
|
|
13654
|
-
}
|
|
13655
|
-
advanceBy(context, isSelfClosing ? 2 : 1);
|
|
13656
|
-
}
|
|
13657
|
-
if (type === 1 /* End */) {
|
|
13658
|
-
return;
|
|
14677
|
+
function fastForward(start, c) {
|
|
14678
|
+
let offset = 0;
|
|
14679
|
+
while (currentInput.charCodeAt(start + offset) !== 62 && start + offset < currentInput.length) {
|
|
14680
|
+
offset++;
|
|
13659
14681
|
}
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
14682
|
+
return offset;
|
|
14683
|
+
}
|
|
14684
|
+
function backTrack(index, c) {
|
|
14685
|
+
let i = index;
|
|
14686
|
+
while (currentInput.charCodeAt(i) !== c && i >= 0)
|
|
14687
|
+
i--;
|
|
14688
|
+
return i;
|
|
14689
|
+
}
|
|
14690
|
+
const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]);
|
|
14691
|
+
function isFragmentTemplate({ tag, props }) {
|
|
14692
|
+
if (tag === "template") {
|
|
13666
14693
|
for (let i = 0; i < props.length; i++) {
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
if (p.name === "if") {
|
|
13670
|
-
hasIf = true;
|
|
13671
|
-
} else if (p.name === "for") {
|
|
13672
|
-
hasFor = true;
|
|
13673
|
-
}
|
|
13674
|
-
}
|
|
13675
|
-
if (hasIf && hasFor) {
|
|
13676
|
-
warnDeprecation(
|
|
13677
|
-
"COMPILER_V_IF_V_FOR_PRECEDENCE",
|
|
13678
|
-
context,
|
|
13679
|
-
getSelection(context, start)
|
|
13680
|
-
);
|
|
13681
|
-
break;
|
|
13682
|
-
}
|
|
13683
|
-
}
|
|
13684
|
-
}
|
|
13685
|
-
let tagType = 0;
|
|
13686
|
-
if (!context.inVPre) {
|
|
13687
|
-
if (tag === "slot") {
|
|
13688
|
-
tagType = 2;
|
|
13689
|
-
} else if (tag === "template") {
|
|
13690
|
-
if (props.some(
|
|
13691
|
-
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
13692
|
-
)) {
|
|
13693
|
-
tagType = 3;
|
|
14694
|
+
if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) {
|
|
14695
|
+
return true;
|
|
13694
14696
|
}
|
|
13695
|
-
} else if (isComponent(tag, props, context)) {
|
|
13696
|
-
tagType = 1;
|
|
13697
14697
|
}
|
|
13698
14698
|
}
|
|
13699
|
-
return
|
|
13700
|
-
type: 1,
|
|
13701
|
-
ns,
|
|
13702
|
-
tag,
|
|
13703
|
-
tagType,
|
|
13704
|
-
props,
|
|
13705
|
-
isSelfClosing,
|
|
13706
|
-
children: [],
|
|
13707
|
-
loc: getSelection(context, start),
|
|
13708
|
-
codegenNode: void 0
|
|
13709
|
-
// to be created during transform phase
|
|
13710
|
-
};
|
|
14699
|
+
return false;
|
|
13711
14700
|
}
|
|
13712
|
-
function isComponent(tag, props
|
|
13713
|
-
|
|
13714
|
-
if (
|
|
14701
|
+
function isComponent({ tag, props }) {
|
|
14702
|
+
var _a;
|
|
14703
|
+
if (currentOptions.isCustomElement(tag)) {
|
|
13715
14704
|
return false;
|
|
13716
14705
|
}
|
|
13717
|
-
if (tag === "component" ||
|
|
14706
|
+
if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || ((_a = currentOptions.isBuiltInComponent) == null ? void 0 : _a.call(currentOptions, tag)) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
|
|
13718
14707
|
return true;
|
|
13719
14708
|
}
|
|
13720
14709
|
for (let i = 0; i < props.length; i++) {
|
|
@@ -13725,374 +14714,179 @@ function isComponent(tag, props, context) {
|
|
|
13725
14714
|
return true;
|
|
13726
14715
|
} else if (checkCompatEnabled(
|
|
13727
14716
|
"COMPILER_IS_ON_ELEMENT",
|
|
13728
|
-
|
|
14717
|
+
currentOptions,
|
|
13729
14718
|
p.loc
|
|
13730
14719
|
)) {
|
|
13731
14720
|
return true;
|
|
13732
14721
|
}
|
|
13733
14722
|
}
|
|
13734
|
-
} else
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
context,
|
|
13742
|
-
p.loc
|
|
13743
|
-
)
|
|
13744
|
-
) {
|
|
13745
|
-
return true;
|
|
13746
|
-
}
|
|
14723
|
+
} else if (// :is on plain element - only treat as component in compat mode
|
|
14724
|
+
p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled(
|
|
14725
|
+
"COMPILER_IS_ON_ELEMENT",
|
|
14726
|
+
currentOptions,
|
|
14727
|
+
p.loc
|
|
14728
|
+
)) {
|
|
14729
|
+
return true;
|
|
13747
14730
|
}
|
|
13748
14731
|
}
|
|
14732
|
+
return false;
|
|
13749
14733
|
}
|
|
13750
|
-
function
|
|
13751
|
-
|
|
13752
|
-
const attributeNames = /* @__PURE__ */ new Set();
|
|
13753
|
-
while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
|
|
13754
|
-
if (startsWith(context.source, "/")) {
|
|
13755
|
-
emitError(context, 22);
|
|
13756
|
-
advanceBy(context, 1);
|
|
13757
|
-
advanceSpaces(context);
|
|
13758
|
-
continue;
|
|
13759
|
-
}
|
|
13760
|
-
if (type === 1 /* End */) {
|
|
13761
|
-
emitError(context, 3);
|
|
13762
|
-
}
|
|
13763
|
-
const attr = parseAttribute(context, attributeNames);
|
|
13764
|
-
if (attr.type === 6 && attr.value && attr.name === "class") {
|
|
13765
|
-
attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
|
|
13766
|
-
}
|
|
13767
|
-
if (type === 0 /* Start */) {
|
|
13768
|
-
props.push(attr);
|
|
13769
|
-
}
|
|
13770
|
-
if (/^[^\t\r\n\f />]/.test(context.source)) {
|
|
13771
|
-
emitError(context, 15);
|
|
13772
|
-
}
|
|
13773
|
-
advanceSpaces(context);
|
|
13774
|
-
}
|
|
13775
|
-
return props;
|
|
14734
|
+
function isUpperCase(c) {
|
|
14735
|
+
return c > 64 && c < 91;
|
|
13776
14736
|
}
|
|
13777
|
-
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
const
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
|
|
13790
|
-
|
|
13791
|
-
|
|
13792
|
-
|
|
13793
|
-
|
|
13794
|
-
|
|
13795
|
-
|
|
13796
|
-
|
|
13797
|
-
);
|
|
13798
|
-
}
|
|
13799
|
-
}
|
|
13800
|
-
advanceBy(context, name.length);
|
|
13801
|
-
let value = void 0;
|
|
13802
|
-
if (/^[\t\r\n\f ]*=/.test(context.source)) {
|
|
13803
|
-
advanceSpaces(context);
|
|
13804
|
-
advanceBy(context, 1);
|
|
13805
|
-
advanceSpaces(context);
|
|
13806
|
-
value = parseAttributeValue(context);
|
|
13807
|
-
if (!value) {
|
|
13808
|
-
emitError(context, 13);
|
|
13809
|
-
}
|
|
13810
|
-
}
|
|
13811
|
-
const loc = getSelection(context, start);
|
|
13812
|
-
if (!context.inVPre && /^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(name)) {
|
|
13813
|
-
const match2 = /(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(
|
|
13814
|
-
name
|
|
13815
|
-
);
|
|
13816
|
-
let isPropShorthand = startsWith(name, ".");
|
|
13817
|
-
let dirName = match2[1] || (isPropShorthand || startsWith(name, ":") ? "bind" : startsWith(name, "@") ? "on" : "slot");
|
|
13818
|
-
let arg;
|
|
13819
|
-
if (match2[2]) {
|
|
13820
|
-
const isSlot = dirName === "slot";
|
|
13821
|
-
const startOffset = name.lastIndexOf(
|
|
13822
|
-
match2[2],
|
|
13823
|
-
name.length - (((_a = match2[3]) == null ? void 0 : _a.length) || 0)
|
|
13824
|
-
);
|
|
13825
|
-
const loc2 = getSelection(
|
|
13826
|
-
context,
|
|
13827
|
-
getNewPosition(context, start, startOffset),
|
|
13828
|
-
getNewPosition(
|
|
13829
|
-
context,
|
|
13830
|
-
start,
|
|
13831
|
-
startOffset + match2[2].length + (isSlot && match2[3] || "").length
|
|
13832
|
-
)
|
|
13833
|
-
);
|
|
13834
|
-
let content = match2[2];
|
|
13835
|
-
let isStatic = true;
|
|
13836
|
-
if (content.startsWith("[")) {
|
|
13837
|
-
isStatic = false;
|
|
13838
|
-
if (!content.endsWith("]")) {
|
|
13839
|
-
emitError(
|
|
13840
|
-
context,
|
|
13841
|
-
27
|
|
13842
|
-
);
|
|
13843
|
-
content = content.slice(1);
|
|
13844
|
-
} else {
|
|
13845
|
-
content = content.slice(1, content.length - 1);
|
|
14737
|
+
const windowsNewlineRE = /\r\n/g;
|
|
14738
|
+
function condenseWhitespace(nodes, tag) {
|
|
14739
|
+
var _a, _b;
|
|
14740
|
+
const shouldCondense = currentOptions.whitespace !== "preserve";
|
|
14741
|
+
let removedWhitespace = false;
|
|
14742
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
14743
|
+
const node = nodes[i];
|
|
14744
|
+
if (node.type === 2) {
|
|
14745
|
+
if (!inPre) {
|
|
14746
|
+
if (isAllWhitespace(node.content)) {
|
|
14747
|
+
const prev = (_a = nodes[i - 1]) == null ? void 0 : _a.type;
|
|
14748
|
+
const next = (_b = nodes[i + 1]) == null ? void 0 : _b.type;
|
|
14749
|
+
if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
|
|
14750
|
+
removedWhitespace = true;
|
|
14751
|
+
nodes[i] = null;
|
|
14752
|
+
} else {
|
|
14753
|
+
node.content = " ";
|
|
14754
|
+
}
|
|
14755
|
+
} else if (shouldCondense) {
|
|
14756
|
+
node.content = condense(node.content);
|
|
13846
14757
|
}
|
|
13847
|
-
} else
|
|
13848
|
-
content
|
|
13849
|
-
}
|
|
13850
|
-
arg = {
|
|
13851
|
-
type: 4,
|
|
13852
|
-
content,
|
|
13853
|
-
isStatic,
|
|
13854
|
-
constType: isStatic ? 3 : 0,
|
|
13855
|
-
loc: loc2
|
|
13856
|
-
};
|
|
13857
|
-
}
|
|
13858
|
-
if (value && value.isQuoted) {
|
|
13859
|
-
const valueLoc = value.loc;
|
|
13860
|
-
valueLoc.start.offset++;
|
|
13861
|
-
valueLoc.start.column++;
|
|
13862
|
-
valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);
|
|
13863
|
-
valueLoc.source = valueLoc.source.slice(1, -1);
|
|
13864
|
-
}
|
|
13865
|
-
const modifiers = match2[3] ? match2[3].slice(1).split(".") : [];
|
|
13866
|
-
if (isPropShorthand)
|
|
13867
|
-
modifiers.push("prop");
|
|
13868
|
-
if (dirName === "bind" && arg) {
|
|
13869
|
-
if (modifiers.includes("sync") && checkCompatEnabled(
|
|
13870
|
-
"COMPILER_V_BIND_SYNC",
|
|
13871
|
-
context,
|
|
13872
|
-
loc,
|
|
13873
|
-
arg.loc.source
|
|
13874
|
-
)) {
|
|
13875
|
-
dirName = "model";
|
|
13876
|
-
modifiers.splice(modifiers.indexOf("sync"), 1);
|
|
13877
|
-
}
|
|
13878
|
-
if (modifiers.includes("prop")) {
|
|
13879
|
-
checkCompatEnabled(
|
|
13880
|
-
"COMPILER_V_BIND_PROP",
|
|
13881
|
-
context,
|
|
13882
|
-
loc
|
|
13883
|
-
);
|
|
14758
|
+
} else {
|
|
14759
|
+
node.content = node.content.replace(windowsNewlineRE, "\n");
|
|
13884
14760
|
}
|
|
13885
14761
|
}
|
|
13886
|
-
return {
|
|
13887
|
-
type: 7,
|
|
13888
|
-
name: dirName,
|
|
13889
|
-
exp: value && {
|
|
13890
|
-
type: 4,
|
|
13891
|
-
content: value.content,
|
|
13892
|
-
isStatic: false,
|
|
13893
|
-
// Treat as non-constant by default. This can be potentially set to
|
|
13894
|
-
// other values by `transformExpression` to make it eligible for hoisting.
|
|
13895
|
-
constType: 0,
|
|
13896
|
-
loc: value.loc
|
|
13897
|
-
},
|
|
13898
|
-
arg,
|
|
13899
|
-
modifiers,
|
|
13900
|
-
loc
|
|
13901
|
-
};
|
|
13902
14762
|
}
|
|
13903
|
-
if (
|
|
13904
|
-
|
|
14763
|
+
if (inPre && tag && currentOptions.isPreTag(tag)) {
|
|
14764
|
+
const first = nodes[0];
|
|
14765
|
+
if (first && first.type === 2) {
|
|
14766
|
+
first.content = first.content.replace(/^\r?\n/, "");
|
|
14767
|
+
}
|
|
13905
14768
|
}
|
|
13906
|
-
return
|
|
13907
|
-
type: 6,
|
|
13908
|
-
name,
|
|
13909
|
-
value: value && {
|
|
13910
|
-
type: 2,
|
|
13911
|
-
content: value.content,
|
|
13912
|
-
loc: value.loc
|
|
13913
|
-
},
|
|
13914
|
-
loc
|
|
13915
|
-
};
|
|
14769
|
+
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
13916
14770
|
}
|
|
13917
|
-
function
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
const isQuoted = quote === `"` || quote === `'`;
|
|
13922
|
-
if (isQuoted) {
|
|
13923
|
-
advanceBy(context, 1);
|
|
13924
|
-
const endIndex = context.source.indexOf(quote);
|
|
13925
|
-
if (endIndex === -1) {
|
|
13926
|
-
content = parseTextData(
|
|
13927
|
-
context,
|
|
13928
|
-
context.source.length,
|
|
13929
|
-
4
|
|
13930
|
-
);
|
|
13931
|
-
} else {
|
|
13932
|
-
content = parseTextData(context, endIndex, 4);
|
|
13933
|
-
advanceBy(context, 1);
|
|
13934
|
-
}
|
|
13935
|
-
} else {
|
|
13936
|
-
const match = /^[^\t\r\n\f >]+/.exec(context.source);
|
|
13937
|
-
if (!match) {
|
|
13938
|
-
return void 0;
|
|
13939
|
-
}
|
|
13940
|
-
const unexpectedChars = /["'<=`]/g;
|
|
13941
|
-
let m;
|
|
13942
|
-
while (m = unexpectedChars.exec(match[0])) {
|
|
13943
|
-
emitError(
|
|
13944
|
-
context,
|
|
13945
|
-
18,
|
|
13946
|
-
m.index
|
|
13947
|
-
);
|
|
14771
|
+
function isAllWhitespace(str) {
|
|
14772
|
+
for (let i = 0; i < str.length; i++) {
|
|
14773
|
+
if (!isWhitespace(str.charCodeAt(i))) {
|
|
14774
|
+
return false;
|
|
13948
14775
|
}
|
|
13949
|
-
|
|
13950
|
-
|
|
13951
|
-
return { content, isQuoted, loc: getSelection(context, start) };
|
|
13952
|
-
}
|
|
13953
|
-
function parseInterpolation(context, mode) {
|
|
13954
|
-
const [open, close] = context.options.delimiters;
|
|
13955
|
-
const closeIndex = context.source.indexOf(close, open.length);
|
|
13956
|
-
if (closeIndex === -1) {
|
|
13957
|
-
emitError(context, 25);
|
|
13958
|
-
return void 0;
|
|
13959
|
-
}
|
|
13960
|
-
const start = getCursor(context);
|
|
13961
|
-
advanceBy(context, open.length);
|
|
13962
|
-
const innerStart = getCursor(context);
|
|
13963
|
-
const innerEnd = getCursor(context);
|
|
13964
|
-
const rawContentLength = closeIndex - open.length;
|
|
13965
|
-
const rawContent = context.source.slice(0, rawContentLength);
|
|
13966
|
-
const preTrimContent = parseTextData(context, rawContentLength, mode);
|
|
13967
|
-
const content = preTrimContent.trim();
|
|
13968
|
-
const startOffset = preTrimContent.indexOf(content);
|
|
13969
|
-
if (startOffset > 0) {
|
|
13970
|
-
advancePositionWithMutation(innerStart, rawContent, startOffset);
|
|
13971
|
-
}
|
|
13972
|
-
const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);
|
|
13973
|
-
advancePositionWithMutation(innerEnd, rawContent, endOffset);
|
|
13974
|
-
advanceBy(context, close.length);
|
|
13975
|
-
return {
|
|
13976
|
-
type: 5,
|
|
13977
|
-
content: {
|
|
13978
|
-
type: 4,
|
|
13979
|
-
isStatic: false,
|
|
13980
|
-
// Set `isConstant` to false by default and will decide in transformExpression
|
|
13981
|
-
constType: 0,
|
|
13982
|
-
content,
|
|
13983
|
-
loc: getSelection(context, innerStart, innerEnd)
|
|
13984
|
-
},
|
|
13985
|
-
loc: getSelection(context, start)
|
|
13986
|
-
};
|
|
14776
|
+
}
|
|
14777
|
+
return true;
|
|
13987
14778
|
}
|
|
13988
|
-
function
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
if (index !== -1 && endIndex > index) {
|
|
13994
|
-
endIndex = index;
|
|
14779
|
+
function hasNewlineChar(str) {
|
|
14780
|
+
for (let i = 0; i < str.length; i++) {
|
|
14781
|
+
const c = str.charCodeAt(i);
|
|
14782
|
+
if (c === 10 || c === 13) {
|
|
14783
|
+
return true;
|
|
13995
14784
|
}
|
|
13996
14785
|
}
|
|
13997
|
-
|
|
13998
|
-
const content = parseTextData(context, endIndex, mode);
|
|
13999
|
-
return {
|
|
14000
|
-
type: 2,
|
|
14001
|
-
content,
|
|
14002
|
-
loc: getSelection(context, start)
|
|
14003
|
-
};
|
|
14786
|
+
return false;
|
|
14004
14787
|
}
|
|
14005
|
-
function
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14788
|
+
function condense(str) {
|
|
14789
|
+
let ret = "";
|
|
14790
|
+
let prevCharIsWhitespace = false;
|
|
14791
|
+
for (let i = 0; i < str.length; i++) {
|
|
14792
|
+
if (isWhitespace(str.charCodeAt(i))) {
|
|
14793
|
+
if (!prevCharIsWhitespace) {
|
|
14794
|
+
ret += " ";
|
|
14795
|
+
prevCharIsWhitespace = true;
|
|
14796
|
+
}
|
|
14797
|
+
} else {
|
|
14798
|
+
ret += str[i];
|
|
14799
|
+
prevCharIsWhitespace = false;
|
|
14800
|
+
}
|
|
14015
14801
|
}
|
|
14802
|
+
return ret;
|
|
14016
14803
|
}
|
|
14017
|
-
function
|
|
14018
|
-
|
|
14019
|
-
return { column, line, offset };
|
|
14804
|
+
function addNode(node) {
|
|
14805
|
+
(stack[0] || currentRoot).children.push(node);
|
|
14020
14806
|
}
|
|
14021
|
-
function
|
|
14022
|
-
end = end || getCursor(context);
|
|
14807
|
+
function getLoc(start, end) {
|
|
14023
14808
|
return {
|
|
14024
|
-
start,
|
|
14025
|
-
|
|
14026
|
-
|
|
14809
|
+
start: tokenizer.getPos(start),
|
|
14810
|
+
// @ts-expect-error allow late attachment
|
|
14811
|
+
end: end == null ? end : tokenizer.getPos(end),
|
|
14812
|
+
// @ts-expect-error allow late attachment
|
|
14813
|
+
source: end == null ? end : getSlice(start, end)
|
|
14027
14814
|
};
|
|
14028
14815
|
}
|
|
14029
|
-
function
|
|
14030
|
-
|
|
14031
|
-
|
|
14032
|
-
function startsWith(source, searchString) {
|
|
14033
|
-
return source.startsWith(searchString);
|
|
14816
|
+
function setLocEnd(loc, end) {
|
|
14817
|
+
loc.end = tokenizer.getPos(end);
|
|
14818
|
+
loc.source = getSlice(loc.start.offset, end);
|
|
14034
14819
|
}
|
|
14035
|
-
function
|
|
14036
|
-
const
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
|
|
14043
|
-
|
|
14820
|
+
function dirToAttr(dir) {
|
|
14821
|
+
const attr = {
|
|
14822
|
+
type: 6,
|
|
14823
|
+
name: dir.rawName,
|
|
14824
|
+
nameLoc: getLoc(
|
|
14825
|
+
dir.loc.start.offset,
|
|
14826
|
+
dir.loc.start.offset + dir.rawName.length
|
|
14827
|
+
),
|
|
14828
|
+
value: void 0,
|
|
14829
|
+
loc: dir.loc
|
|
14830
|
+
};
|
|
14831
|
+
if (dir.exp) {
|
|
14832
|
+
const loc = dir.exp.loc;
|
|
14833
|
+
if (loc.end.offset < dir.loc.end.offset) {
|
|
14834
|
+
loc.start.offset--;
|
|
14835
|
+
loc.start.column--;
|
|
14836
|
+
loc.end.offset++;
|
|
14837
|
+
loc.end.column++;
|
|
14838
|
+
}
|
|
14839
|
+
attr.value = {
|
|
14840
|
+
type: 2,
|
|
14841
|
+
content: dir.exp.content,
|
|
14842
|
+
loc
|
|
14843
|
+
};
|
|
14044
14844
|
}
|
|
14845
|
+
return attr;
|
|
14045
14846
|
}
|
|
14046
|
-
function
|
|
14047
|
-
|
|
14048
|
-
start,
|
|
14049
|
-
context.originalSource.slice(start.offset, numberOfCharacters),
|
|
14050
|
-
numberOfCharacters
|
|
14051
|
-
);
|
|
14847
|
+
function emitError(code, index) {
|
|
14848
|
+
currentOptions.onError(createCompilerError(code, getLoc(index, index)));
|
|
14052
14849
|
}
|
|
14053
|
-
function
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
end: loc,
|
|
14062
|
-
source: ""
|
|
14063
|
-
})
|
|
14064
|
-
);
|
|
14850
|
+
function reset() {
|
|
14851
|
+
tokenizer.reset();
|
|
14852
|
+
currentOpenTag = null;
|
|
14853
|
+
currentProp = null;
|
|
14854
|
+
currentAttrValue = "";
|
|
14855
|
+
currentAttrStartIndex = -1;
|
|
14856
|
+
currentAttrEndIndex = -1;
|
|
14857
|
+
stack.length = 0;
|
|
14065
14858
|
}
|
|
14066
|
-
function
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
|
|
14071
|
-
|
|
14072
|
-
|
|
14073
|
-
|
|
14074
|
-
|
|
14075
|
-
}
|
|
14076
|
-
}
|
|
14077
|
-
break;
|
|
14078
|
-
case 1:
|
|
14079
|
-
case 2: {
|
|
14080
|
-
const parent = last(ancestors);
|
|
14081
|
-
if (parent && startsWithEndTagOpen(s, parent.tag)) {
|
|
14082
|
-
return true;
|
|
14859
|
+
function baseParse(input, options) {
|
|
14860
|
+
reset();
|
|
14861
|
+
currentInput = input;
|
|
14862
|
+
currentOptions = extend({}, defaultParserOptions);
|
|
14863
|
+
if (options) {
|
|
14864
|
+
let key;
|
|
14865
|
+
for (key in options) {
|
|
14866
|
+
if (options[key] != null) {
|
|
14867
|
+
currentOptions[key] = options[key];
|
|
14083
14868
|
}
|
|
14084
|
-
break;
|
|
14085
14869
|
}
|
|
14086
|
-
case 3:
|
|
14087
|
-
if (startsWith(s, "]]>")) {
|
|
14088
|
-
return true;
|
|
14089
|
-
}
|
|
14090
|
-
break;
|
|
14091
14870
|
}
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14095
|
-
|
|
14871
|
+
{
|
|
14872
|
+
if (!currentOptions.decodeEntities) {
|
|
14873
|
+
throw new Error(
|
|
14874
|
+
`[@vue/compiler-core] decodeEntities option is required in browser builds.`
|
|
14875
|
+
);
|
|
14876
|
+
}
|
|
14877
|
+
}
|
|
14878
|
+
tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
|
|
14879
|
+
const delimiters = options == null ? void 0 : options.delimiters;
|
|
14880
|
+
if (delimiters) {
|
|
14881
|
+
tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
|
|
14882
|
+
tokenizer.delimiterClose = toCharCodes(delimiters[1]);
|
|
14883
|
+
}
|
|
14884
|
+
const root = currentRoot = createRoot([], input);
|
|
14885
|
+
tokenizer.parse(currentInput);
|
|
14886
|
+
root.loc = getLoc(0, input.length);
|
|
14887
|
+
root.children = condenseWhitespace(root.children);
|
|
14888
|
+
currentRoot = null;
|
|
14889
|
+
return root;
|
|
14096
14890
|
}
|
|
14097
14891
|
|
|
14098
14892
|
function hoistStatic(root, context) {
|
|
@@ -14504,6 +15298,7 @@ function transform(root, options) {
|
|
|
14504
15298
|
root.hoists = context.hoists;
|
|
14505
15299
|
root.temps = context.temps;
|
|
14506
15300
|
root.cached = context.cached;
|
|
15301
|
+
root.transformed = true;
|
|
14507
15302
|
{
|
|
14508
15303
|
root.filters = [...context.filters];
|
|
14509
15304
|
}
|
|
@@ -14660,7 +15455,7 @@ function createCodegenContext(ast, {
|
|
|
14660
15455
|
ssr,
|
|
14661
15456
|
isTS,
|
|
14662
15457
|
inSSR,
|
|
14663
|
-
source: ast.
|
|
15458
|
+
source: ast.source,
|
|
14664
15459
|
code: ``,
|
|
14665
15460
|
column: 1,
|
|
14666
15461
|
line: 1,
|
|
@@ -14671,7 +15466,7 @@ function createCodegenContext(ast, {
|
|
|
14671
15466
|
helper(key) {
|
|
14672
15467
|
return `_${helperNameMap[key]}`;
|
|
14673
15468
|
},
|
|
14674
|
-
push(code, node) {
|
|
15469
|
+
push(code, newlineIndex = -2 /* None */, node) {
|
|
14675
15470
|
context.code += code;
|
|
14676
15471
|
},
|
|
14677
15472
|
indent() {
|
|
@@ -14689,7 +15484,7 @@ function createCodegenContext(ast, {
|
|
|
14689
15484
|
}
|
|
14690
15485
|
};
|
|
14691
15486
|
function newline(n) {
|
|
14692
|
-
context.push("\n" + ` `.repeat(n));
|
|
15487
|
+
context.push("\n" + ` `.repeat(n), 0 /* Start */);
|
|
14693
15488
|
}
|
|
14694
15489
|
return context;
|
|
14695
15490
|
}
|
|
@@ -14726,9 +15521,11 @@ function generate(ast, options = {}) {
|
|
|
14726
15521
|
push(`with (_ctx) {`);
|
|
14727
15522
|
indent();
|
|
14728
15523
|
if (hasHelpers) {
|
|
14729
|
-
push(
|
|
14730
|
-
|
|
14731
|
-
|
|
15524
|
+
push(
|
|
15525
|
+
`const { ${helpers.map(aliasHelper).join(", ")} } = _Vue
|
|
15526
|
+
`,
|
|
15527
|
+
-1 /* End */
|
|
15528
|
+
);
|
|
14732
15529
|
newline();
|
|
14733
15530
|
}
|
|
14734
15531
|
}
|
|
@@ -14757,7 +15554,7 @@ function generate(ast, options = {}) {
|
|
|
14757
15554
|
}
|
|
14758
15555
|
if (ast.components.length || ast.directives.length || ast.temps) {
|
|
14759
15556
|
push(`
|
|
14760
|
-
|
|
15557
|
+
`, 0 /* Start */);
|
|
14761
15558
|
newline();
|
|
14762
15559
|
}
|
|
14763
15560
|
if (!ssr) {
|
|
@@ -14778,7 +15575,6 @@ function generate(ast, options = {}) {
|
|
|
14778
15575
|
ast,
|
|
14779
15576
|
code: context.code,
|
|
14780
15577
|
preamble: isSetupInlined ? preambleContext.code : ``,
|
|
14781
|
-
// SourceMapGenerator does have toJSON() method but it's not in the types
|
|
14782
15578
|
map: context.map ? context.map.toJSON() : void 0
|
|
14783
15579
|
};
|
|
14784
15580
|
}
|
|
@@ -14797,7 +15593,7 @@ function genFunctionPreamble(ast, context) {
|
|
|
14797
15593
|
if (helpers.length > 0) {
|
|
14798
15594
|
{
|
|
14799
15595
|
push(`const _Vue = ${VueBinding}
|
|
14800
|
-
|
|
15596
|
+
`, -1 /* End */);
|
|
14801
15597
|
if (ast.hoists.length) {
|
|
14802
15598
|
const staticHelpers = [
|
|
14803
15599
|
CREATE_VNODE,
|
|
@@ -14807,7 +15603,7 @@ function genFunctionPreamble(ast, context) {
|
|
|
14807
15603
|
CREATE_STATIC
|
|
14808
15604
|
].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", ");
|
|
14809
15605
|
push(`const { ${staticHelpers} } = _Vue
|
|
14810
|
-
|
|
15606
|
+
`, -1 /* End */);
|
|
14811
15607
|
}
|
|
14812
15608
|
}
|
|
14813
15609
|
}
|
|
@@ -14868,7 +15664,7 @@ function genNodeList(nodes, context, multilines = false, comma = true) {
|
|
|
14868
15664
|
for (let i = 0; i < nodes.length; i++) {
|
|
14869
15665
|
const node = nodes[i];
|
|
14870
15666
|
if (isString(node)) {
|
|
14871
|
-
push(node);
|
|
15667
|
+
push(node, -3 /* Unknown */);
|
|
14872
15668
|
} else if (isArray(node)) {
|
|
14873
15669
|
genNodeListAsArray(node, context);
|
|
14874
15670
|
} else {
|
|
@@ -14886,7 +15682,7 @@ function genNodeList(nodes, context, multilines = false, comma = true) {
|
|
|
14886
15682
|
}
|
|
14887
15683
|
function genNode(node, context) {
|
|
14888
15684
|
if (isString(node)) {
|
|
14889
|
-
context.push(node);
|
|
15685
|
+
context.push(node, -3 /* Unknown */);
|
|
14890
15686
|
return;
|
|
14891
15687
|
}
|
|
14892
15688
|
if (isSymbol(node)) {
|
|
@@ -14966,11 +15762,15 @@ function genNode(node, context) {
|
|
|
14966
15762
|
}
|
|
14967
15763
|
}
|
|
14968
15764
|
function genText(node, context) {
|
|
14969
|
-
context.push(JSON.stringify(node.content), node);
|
|
15765
|
+
context.push(JSON.stringify(node.content), -3 /* Unknown */, node);
|
|
14970
15766
|
}
|
|
14971
15767
|
function genExpression(node, context) {
|
|
14972
15768
|
const { content, isStatic } = node;
|
|
14973
|
-
context.push(
|
|
15769
|
+
context.push(
|
|
15770
|
+
isStatic ? JSON.stringify(content) : content,
|
|
15771
|
+
-3 /* Unknown */,
|
|
15772
|
+
node
|
|
15773
|
+
);
|
|
14974
15774
|
}
|
|
14975
15775
|
function genInterpolation(node, context) {
|
|
14976
15776
|
const { push, helper, pure } = context;
|
|
@@ -14984,7 +15784,7 @@ function genCompoundExpression(node, context) {
|
|
|
14984
15784
|
for (let i = 0; i < node.children.length; i++) {
|
|
14985
15785
|
const child = node.children[i];
|
|
14986
15786
|
if (isString(child)) {
|
|
14987
|
-
context.push(child);
|
|
15787
|
+
context.push(child, -3 /* Unknown */);
|
|
14988
15788
|
} else {
|
|
14989
15789
|
genNode(child, context);
|
|
14990
15790
|
}
|
|
@@ -14998,9 +15798,9 @@ function genExpressionAsPropertyKey(node, context) {
|
|
|
14998
15798
|
push(`]`);
|
|
14999
15799
|
} else if (node.isStatic) {
|
|
15000
15800
|
const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content);
|
|
15001
|
-
push(text, node);
|
|
15801
|
+
push(text, -2 /* None */, node);
|
|
15002
15802
|
} else {
|
|
15003
|
-
push(`[${node.content}]`, node);
|
|
15803
|
+
push(`[${node.content}]`, -3 /* Unknown */, node);
|
|
15004
15804
|
}
|
|
15005
15805
|
}
|
|
15006
15806
|
function genComment(node, context) {
|
|
@@ -15008,7 +15808,11 @@ function genComment(node, context) {
|
|
|
15008
15808
|
if (pure) {
|
|
15009
15809
|
push(PURE_ANNOTATION);
|
|
15010
15810
|
}
|
|
15011
|
-
push(
|
|
15811
|
+
push(
|
|
15812
|
+
`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`,
|
|
15813
|
+
-3 /* Unknown */,
|
|
15814
|
+
node
|
|
15815
|
+
);
|
|
15012
15816
|
}
|
|
15013
15817
|
function genVNodeCall(node, context) {
|
|
15014
15818
|
const { push, helper, pure } = context;
|
|
@@ -15033,7 +15837,7 @@ function genVNodeCall(node, context) {
|
|
|
15033
15837
|
push(PURE_ANNOTATION);
|
|
15034
15838
|
}
|
|
15035
15839
|
const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);
|
|
15036
|
-
push(helper(callHelper) + `(`, node);
|
|
15840
|
+
push(helper(callHelper) + `(`, -2 /* None */, node);
|
|
15037
15841
|
genNodeList(
|
|
15038
15842
|
genNullableArgs([tag, props, children, patchFlag, dynamicProps]),
|
|
15039
15843
|
context
|
|
@@ -15062,7 +15866,7 @@ function genCallExpression(node, context) {
|
|
|
15062
15866
|
if (pure) {
|
|
15063
15867
|
push(PURE_ANNOTATION);
|
|
15064
15868
|
}
|
|
15065
|
-
push(callee + `(`, node);
|
|
15869
|
+
push(callee + `(`, -2 /* None */, node);
|
|
15066
15870
|
genNodeList(node.arguments, context);
|
|
15067
15871
|
push(`)`);
|
|
15068
15872
|
}
|
|
@@ -15070,7 +15874,7 @@ function genObjectExpression(node, context) {
|
|
|
15070
15874
|
const { push, indent, deindent, newline } = context;
|
|
15071
15875
|
const { properties } = node;
|
|
15072
15876
|
if (!properties.length) {
|
|
15073
|
-
push(`{}`, node);
|
|
15877
|
+
push(`{}`, -2 /* None */, node);
|
|
15074
15878
|
return;
|
|
15075
15879
|
}
|
|
15076
15880
|
const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
|
|
@@ -15098,7 +15902,7 @@ function genFunctionExpression(node, context) {
|
|
|
15098
15902
|
if (isSlot) {
|
|
15099
15903
|
push(`_${helperNameMap[WITH_CTX]}(`);
|
|
15100
15904
|
}
|
|
15101
|
-
push(`(`, node);
|
|
15905
|
+
push(`(`, -2 /* None */, node);
|
|
15102
15906
|
if (isArray(params)) {
|
|
15103
15907
|
genNodeList(params, context);
|
|
15104
15908
|
} else if (params) {
|
|
@@ -15332,7 +16136,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15332
16136
|
context.removeNode();
|
|
15333
16137
|
const branch = createIfBranch(node, dir);
|
|
15334
16138
|
if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
|
|
15335
|
-
!(context.parent && context.parent.type === 1 &&
|
|
16139
|
+
!(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) {
|
|
15336
16140
|
branch.children = [...comments, ...branch.children];
|
|
15337
16141
|
}
|
|
15338
16142
|
{
|
|
@@ -15614,18 +16418,14 @@ function processFor(node, dir, context, processCodegen) {
|
|
|
15614
16418
|
);
|
|
15615
16419
|
return;
|
|
15616
16420
|
}
|
|
15617
|
-
const parseResult =
|
|
15618
|
-
// can only be simple expression because vFor transform is applied
|
|
15619
|
-
// before expression transform.
|
|
15620
|
-
dir.exp,
|
|
15621
|
-
context
|
|
15622
|
-
);
|
|
16421
|
+
const parseResult = dir.forParseResult;
|
|
15623
16422
|
if (!parseResult) {
|
|
15624
16423
|
context.onError(
|
|
15625
16424
|
createCompilerError(32, dir.loc)
|
|
15626
16425
|
);
|
|
15627
16426
|
return;
|
|
15628
16427
|
}
|
|
16428
|
+
finalizeForParseResult(parseResult, context);
|
|
15629
16429
|
const { addIdentifiers, removeIdentifiers, scopes } = context;
|
|
15630
16430
|
const { source, value, key, index } = parseResult;
|
|
15631
16431
|
const forNode = {
|
|
@@ -15647,70 +16447,26 @@ function processFor(node, dir, context, processCodegen) {
|
|
|
15647
16447
|
onExit();
|
|
15648
16448
|
};
|
|
15649
16449
|
}
|
|
15650
|
-
|
|
15651
|
-
|
|
15652
|
-
function parseForExpression(input, context) {
|
|
15653
|
-
const loc = input.loc;
|
|
15654
|
-
const exp = input.content;
|
|
15655
|
-
const inMatch = exp.match(forAliasRE);
|
|
15656
|
-
if (!inMatch)
|
|
16450
|
+
function finalizeForParseResult(result, context) {
|
|
16451
|
+
if (result.finalized)
|
|
15657
16452
|
return;
|
|
15658
|
-
const [, LHS, RHS] = inMatch;
|
|
15659
|
-
const result = {
|
|
15660
|
-
source: createAliasExpression(
|
|
15661
|
-
loc,
|
|
15662
|
-
RHS.trim(),
|
|
15663
|
-
exp.indexOf(RHS, LHS.length)
|
|
15664
|
-
),
|
|
15665
|
-
value: void 0,
|
|
15666
|
-
key: void 0,
|
|
15667
|
-
index: void 0
|
|
15668
|
-
};
|
|
15669
16453
|
{
|
|
15670
16454
|
validateBrowserExpression(result.source, context);
|
|
15671
|
-
|
|
15672
|
-
|
|
15673
|
-
|
|
15674
|
-
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
const keyContent = iteratorMatch[1].trim();
|
|
15678
|
-
let keyOffset;
|
|
15679
|
-
if (keyContent) {
|
|
15680
|
-
keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
|
|
15681
|
-
result.key = createAliasExpression(loc, keyContent, keyOffset);
|
|
15682
|
-
{
|
|
15683
|
-
validateBrowserExpression(
|
|
15684
|
-
result.key,
|
|
15685
|
-
context,
|
|
15686
|
-
true
|
|
15687
|
-
);
|
|
15688
|
-
}
|
|
16455
|
+
if (result.key) {
|
|
16456
|
+
validateBrowserExpression(
|
|
16457
|
+
result.key,
|
|
16458
|
+
context,
|
|
16459
|
+
true
|
|
16460
|
+
);
|
|
15689
16461
|
}
|
|
15690
|
-
if (
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15696
|
-
exp.indexOf(
|
|
15697
|
-
indexContent,
|
|
15698
|
-
result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
|
|
15699
|
-
)
|
|
15700
|
-
);
|
|
15701
|
-
{
|
|
15702
|
-
validateBrowserExpression(
|
|
15703
|
-
result.index,
|
|
15704
|
-
context,
|
|
15705
|
-
true
|
|
15706
|
-
);
|
|
15707
|
-
}
|
|
15708
|
-
}
|
|
16462
|
+
if (result.index) {
|
|
16463
|
+
validateBrowserExpression(
|
|
16464
|
+
result.index,
|
|
16465
|
+
context,
|
|
16466
|
+
true
|
|
16467
|
+
);
|
|
15709
16468
|
}
|
|
15710
|
-
|
|
15711
|
-
if (valueContent) {
|
|
15712
|
-
result.value = createAliasExpression(loc, valueContent, trimmedOffset);
|
|
15713
|
-
{
|
|
16469
|
+
if (result.value) {
|
|
15714
16470
|
validateBrowserExpression(
|
|
15715
16471
|
result.value,
|
|
15716
16472
|
context,
|
|
@@ -15718,14 +16474,7 @@ function parseForExpression(input, context) {
|
|
|
15718
16474
|
);
|
|
15719
16475
|
}
|
|
15720
16476
|
}
|
|
15721
|
-
|
|
15722
|
-
}
|
|
15723
|
-
function createAliasExpression(range, content, offset) {
|
|
15724
|
-
return createSimpleExpression(
|
|
15725
|
-
content,
|
|
15726
|
-
false,
|
|
15727
|
-
getInnerRange(range, offset, content.length)
|
|
15728
|
-
);
|
|
16477
|
+
result.finalized = true;
|
|
15729
16478
|
}
|
|
15730
16479
|
function createForLoopParams({ value, key, index }, memoArgs = []) {
|
|
15731
16480
|
return createParamsList([value, key, index, ...memoArgs]);
|
|
@@ -15812,12 +16561,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15812
16561
|
hasDynamicSlots = true;
|
|
15813
16562
|
}
|
|
15814
16563
|
const vFor = findDir(slotElement, "for");
|
|
15815
|
-
const slotFunction = buildSlotFn(
|
|
15816
|
-
slotProps,
|
|
15817
|
-
vFor == null ? void 0 : vFor.exp,
|
|
15818
|
-
slotChildren,
|
|
15819
|
-
slotLoc
|
|
15820
|
-
);
|
|
16564
|
+
const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc);
|
|
15821
16565
|
let vIf;
|
|
15822
16566
|
let vElse;
|
|
15823
16567
|
if (vIf = findDir(slotElement, "if")) {
|
|
@@ -15866,8 +16610,9 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15866
16610
|
}
|
|
15867
16611
|
} else if (vFor) {
|
|
15868
16612
|
hasDynamicSlots = true;
|
|
15869
|
-
const parseResult = vFor.
|
|
16613
|
+
const parseResult = vFor.forParseResult;
|
|
15870
16614
|
if (parseResult) {
|
|
16615
|
+
finalizeForParseResult(parseResult, context);
|
|
15871
16616
|
dynamicSlots.push(
|
|
15872
16617
|
createCallExpression(context.helper(RENDER_LIST), [
|
|
15873
16618
|
parseResult.source,
|
|
@@ -16128,17 +16873,6 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
16128
16873
|
tag = isProp.value.content.slice(4);
|
|
16129
16874
|
}
|
|
16130
16875
|
}
|
|
16131
|
-
const isDir = !isExplicitDynamic && findDir(node, "is");
|
|
16132
|
-
if (isDir && isDir.exp) {
|
|
16133
|
-
{
|
|
16134
|
-
context.onWarn(
|
|
16135
|
-
createCompilerError(52, isDir.loc)
|
|
16136
|
-
);
|
|
16137
|
-
}
|
|
16138
|
-
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
|
16139
|
-
isDir.exp
|
|
16140
|
-
]);
|
|
16141
|
-
}
|
|
16142
16876
|
const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
|
|
16143
16877
|
if (builtIn) {
|
|
16144
16878
|
if (!ssr)
|
|
@@ -16210,7 +16944,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16210
16944
|
for (let i = 0; i < props.length; i++) {
|
|
16211
16945
|
const prop = props[i];
|
|
16212
16946
|
if (prop.type === 6) {
|
|
16213
|
-
const { loc, name, value } = prop;
|
|
16947
|
+
const { loc, name, nameLoc, value } = prop;
|
|
16214
16948
|
let isStatic = true;
|
|
16215
16949
|
if (name === "ref") {
|
|
16216
16950
|
hasRef = true;
|
|
@@ -16231,11 +16965,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16231
16965
|
}
|
|
16232
16966
|
properties.push(
|
|
16233
16967
|
createObjectProperty(
|
|
16234
|
-
createSimpleExpression(
|
|
16235
|
-
name,
|
|
16236
|
-
true,
|
|
16237
|
-
getInnerRange(loc, 0, name.length)
|
|
16238
|
-
),
|
|
16968
|
+
createSimpleExpression(name, true, nameLoc),
|
|
16239
16969
|
createSimpleExpression(
|
|
16240
16970
|
value ? value.content : "",
|
|
16241
16971
|
isStatic,
|
|
@@ -16717,8 +17447,13 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
16717
17447
|
};
|
|
16718
17448
|
|
|
16719
17449
|
const transformBind = (dir, _node, context) => {
|
|
16720
|
-
const {
|
|
17450
|
+
const { modifiers, loc } = dir;
|
|
16721
17451
|
const arg = dir.arg;
|
|
17452
|
+
let { exp } = dir;
|
|
17453
|
+
if (!exp && arg.type === 4) {
|
|
17454
|
+
const propName = camelize(arg.content);
|
|
17455
|
+
exp = dir.exp = createSimpleExpression(propName, false, arg.loc);
|
|
17456
|
+
}
|
|
16722
17457
|
if (arg.type !== 4) {
|
|
16723
17458
|
arg.children.unshift(`(`);
|
|
16724
17459
|
arg.children.push(`) || ""`);
|
|
@@ -17117,7 +17852,7 @@ function getBaseTransformPreset(prefixIdentifiers) {
|
|
|
17117
17852
|
}
|
|
17118
17853
|
];
|
|
17119
17854
|
}
|
|
17120
|
-
function baseCompile(
|
|
17855
|
+
function baseCompile(source, options = {}) {
|
|
17121
17856
|
const onError = options.onError || defaultOnError;
|
|
17122
17857
|
const isModuleMode = options.mode === "module";
|
|
17123
17858
|
{
|
|
@@ -17134,7 +17869,7 @@ function baseCompile(template, options = {}) {
|
|
|
17134
17869
|
if (options.scopeId && !isModuleMode) {
|
|
17135
17870
|
onError(createCompilerError(50));
|
|
17136
17871
|
}
|
|
17137
|
-
const ast = isString(
|
|
17872
|
+
const ast = isString(source) ? baseParse(source, options) : source;
|
|
17138
17873
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
17139
17874
|
transform(
|
|
17140
17875
|
ast,
|
|
@@ -17200,25 +17935,22 @@ function decodeHtmlBrowser(raw, asAttr = false) {
|
|
|
17200
17935
|
}
|
|
17201
17936
|
}
|
|
17202
17937
|
|
|
17203
|
-
const isRawTextContainer = /* @__PURE__ */ makeMap(
|
|
17204
|
-
"style,iframe,script,noscript",
|
|
17205
|
-
true
|
|
17206
|
-
);
|
|
17207
17938
|
const parserOptions = {
|
|
17939
|
+
parseMode: "html",
|
|
17208
17940
|
isVoidTag,
|
|
17209
17941
|
isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
|
|
17210
17942
|
isPreTag: (tag) => tag === "pre",
|
|
17211
17943
|
decodeEntities: decodeHtmlBrowser ,
|
|
17212
17944
|
isBuiltInComponent: (tag) => {
|
|
17213
|
-
if (
|
|
17945
|
+
if (tag === "Transition" || tag === "transition") {
|
|
17214
17946
|
return TRANSITION;
|
|
17215
|
-
} else if (
|
|
17947
|
+
} else if (tag === "TransitionGroup" || tag === "transition-group") {
|
|
17216
17948
|
return TRANSITION_GROUP;
|
|
17217
17949
|
}
|
|
17218
17950
|
},
|
|
17219
17951
|
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
|
|
17220
|
-
getNamespace(tag, parent) {
|
|
17221
|
-
let ns = parent ? parent.ns :
|
|
17952
|
+
getNamespace(tag, parent, rootNamespace) {
|
|
17953
|
+
let ns = parent ? parent.ns : rootNamespace;
|
|
17222
17954
|
if (parent && ns === 2) {
|
|
17223
17955
|
if (parent.tag === "annotation-xml") {
|
|
17224
17956
|
if (tag === "svg") {
|
|
@@ -17246,18 +17978,6 @@ const parserOptions = {
|
|
|
17246
17978
|
}
|
|
17247
17979
|
}
|
|
17248
17980
|
return ns;
|
|
17249
|
-
},
|
|
17250
|
-
// https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments
|
|
17251
|
-
getTextMode({ tag, ns }) {
|
|
17252
|
-
if (ns === 0) {
|
|
17253
|
-
if (tag === "textarea" || tag === "title") {
|
|
17254
|
-
return 1;
|
|
17255
|
-
}
|
|
17256
|
-
if (isRawTextContainer(tag)) {
|
|
17257
|
-
return 2;
|
|
17258
|
-
}
|
|
17259
|
-
}
|
|
17260
|
-
return 0;
|
|
17261
17981
|
}
|
|
17262
17982
|
};
|
|
17263
17983
|
|
|
@@ -17578,6 +18298,7 @@ const transformTransition = (node, context) => {
|
|
|
17578
18298
|
node.props.push({
|
|
17579
18299
|
type: 6,
|
|
17580
18300
|
name: "persisted",
|
|
18301
|
+
nameLoc: node.loc,
|
|
17581
18302
|
value: void 0,
|
|
17582
18303
|
loc: node.loc
|
|
17583
18304
|
});
|
|
@@ -17622,9 +18343,9 @@ const DOMDirectiveTransforms = {
|
|
|
17622
18343
|
// override compiler-core
|
|
17623
18344
|
show: transformShow
|
|
17624
18345
|
};
|
|
17625
|
-
function compile(
|
|
18346
|
+
function compile(src, options = {}) {
|
|
17626
18347
|
return baseCompile(
|
|
17627
|
-
|
|
18348
|
+
src,
|
|
17628
18349
|
extend({}, parserOptions, options, {
|
|
17629
18350
|
nodeTransforms: [
|
|
17630
18351
|
// ignore <script> and <tag>
|
|
@@ -17702,4 +18423,4 @@ var Vue$1 = Vue;
|
|
|
17702
18423
|
|
|
17703
18424
|
const { configureCompat } = Vue$1;
|
|
17704
18425
|
|
|
17705
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|
|
18426
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|