vue 2.6.7 → 2.6.11
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/README.md +72 -52
- package/dist/README.md +1 -1
- package/dist/vue.common.dev.js +109 -51
- package/dist/vue.common.prod.js +2 -2
- package/dist/vue.esm.browser.js +109 -51
- package/dist/vue.esm.browser.min.js +2 -2
- package/dist/vue.esm.js +109 -51
- package/dist/vue.js +109 -51
- package/dist/vue.min.js +2 -2
- package/dist/vue.runtime.common.dev.js +80 -38
- package/dist/vue.runtime.common.prod.js +2 -2
- package/dist/vue.runtime.esm.js +80 -38
- package/dist/vue.runtime.js +80 -38
- package/dist/vue.runtime.min.js +2 -2
- package/package.json +4 -4
- package/src/compiler/codegen/events.js +1 -1
- package/src/compiler/codegen/index.js +1 -1
- package/src/compiler/error-detector.js +18 -3
- package/src/compiler/parser/html-parser.js +5 -5
- package/src/compiler/parser/index.js +7 -6
- package/src/core/instance/proxy.js +1 -1
- package/src/core/instance/render-helpers/bind-dynamic-keys.js +1 -1
- package/src/core/instance/render-helpers/bind-object-props.js +5 -3
- package/src/core/instance/render.js +1 -1
- package/src/core/observer/scheduler.js +17 -6
- package/src/core/util/env.js +1 -2
- package/src/core/util/error.js +4 -3
- package/src/core/util/lang.js +2 -2
- package/src/core/util/next-tick.js +1 -1
- package/src/core/util/options.js +2 -2
- package/src/core/vdom/create-element.js +6 -0
- package/src/core/vdom/helpers/normalize-scoped-slots.js +9 -4
- package/src/core/vdom/helpers/resolve-async-component.js +25 -8
- package/src/core/vdom/patch.js +4 -4
- package/src/platforms/web/compiler/modules/model.js +1 -1
- package/src/platforms/web/runtime/modules/dom-props.js +2 -1
- package/src/platforms/web/runtime/modules/events.js +4 -2
- package/src/platforms/web/runtime/modules/transition.js +1 -1
- package/src/server/template-renderer/create-async-file-mapper.js +2 -2
- package/src/server/write.js +1 -1
- package/types/index.d.ts +1 -2
- package/types/options.d.ts +3 -3
- package/types/umd.d.ts +48 -0
- package/types/vnode.d.ts +6 -2
- package/types/vue.d.ts +3 -3
package/dist/vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.6.
|
|
2
|
+
* Vue.js v2.6.11
|
|
3
3
|
* (c) 2014-2019 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -481,7 +481,7 @@
|
|
|
481
481
|
* using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
|
|
482
482
|
* skipping \u10000-\uEFFFF due to it freezing up PhantomJS
|
|
483
483
|
*/
|
|
484
|
-
var
|
|
484
|
+
var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
|
|
485
485
|
|
|
486
486
|
/**
|
|
487
487
|
* Check if a string starts with $ or _
|
|
@@ -506,7 +506,7 @@
|
|
|
506
506
|
/**
|
|
507
507
|
* Parse simple path.
|
|
508
508
|
*/
|
|
509
|
-
var bailRE = new RegExp(("[^" +
|
|
509
|
+
var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
|
|
510
510
|
function parsePath (path) {
|
|
511
511
|
if (bailRE.test(path)) {
|
|
512
512
|
return
|
|
@@ -1410,7 +1410,7 @@
|
|
|
1410
1410
|
}
|
|
1411
1411
|
|
|
1412
1412
|
function validateComponentName (name) {
|
|
1413
|
-
if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" +
|
|
1413
|
+
if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
|
|
1414
1414
|
warn(
|
|
1415
1415
|
'Invalid component name: "' + name + '". Component names ' +
|
|
1416
1416
|
'should conform to valid custom element name in html5 specification.'
|
|
@@ -1861,10 +1861,11 @@
|
|
|
1861
1861
|
var res;
|
|
1862
1862
|
try {
|
|
1863
1863
|
res = args ? handler.apply(context, args) : handler.call(context);
|
|
1864
|
-
if (res && !res._isVue && isPromise(res)) {
|
|
1864
|
+
if (res && !res._isVue && isPromise(res) && !res._handled) {
|
|
1865
|
+
res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
|
|
1865
1866
|
// issue #9511
|
|
1866
|
-
//
|
|
1867
|
-
res =
|
|
1867
|
+
// avoid catch triggering multiple times when nested calls
|
|
1868
|
+
res._handled = true;
|
|
1868
1869
|
}
|
|
1869
1870
|
} catch (e) {
|
|
1870
1871
|
handleError(e, vm, info);
|
|
@@ -1968,7 +1969,7 @@
|
|
|
1968
1969
|
isUsingMicroTask = true;
|
|
1969
1970
|
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
|
|
1970
1971
|
// Fallback to setImmediate.
|
|
1971
|
-
//
|
|
1972
|
+
// Technically it leverages the (macro) task queue,
|
|
1972
1973
|
// but it is still a better choice than setTimeout.
|
|
1973
1974
|
timerFunc = function () {
|
|
1974
1975
|
setImmediate(flushCallbacks);
|
|
@@ -2057,7 +2058,7 @@
|
|
|
2057
2058
|
warn(
|
|
2058
2059
|
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
|
|
2059
2060
|
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
|
2060
|
-
'prevent conflicts with Vue internals' +
|
|
2061
|
+
'prevent conflicts with Vue internals. ' +
|
|
2061
2062
|
'See: https://vuejs.org/v2/api/#data',
|
|
2062
2063
|
target
|
|
2063
2064
|
);
|
|
@@ -2547,7 +2548,8 @@
|
|
|
2547
2548
|
prevSlots
|
|
2548
2549
|
) {
|
|
2549
2550
|
var res;
|
|
2550
|
-
var
|
|
2551
|
+
var hasNormalSlots = Object.keys(normalSlots).length > 0;
|
|
2552
|
+
var isStable = slots ? !!slots.$stable : !hasNormalSlots;
|
|
2551
2553
|
var key = slots && slots.$key;
|
|
2552
2554
|
if (!slots) {
|
|
2553
2555
|
res = {};
|
|
@@ -2559,7 +2561,8 @@
|
|
|
2559
2561
|
prevSlots &&
|
|
2560
2562
|
prevSlots !== emptyObject &&
|
|
2561
2563
|
key === prevSlots.$key &&
|
|
2562
|
-
|
|
2564
|
+
!hasNormalSlots &&
|
|
2565
|
+
!prevSlots.$hasNormal
|
|
2563
2566
|
) {
|
|
2564
2567
|
// fast path 2: stable scoped slots w/ no normal slots to proxy,
|
|
2565
2568
|
// only need to normalize once
|
|
@@ -2585,6 +2588,7 @@
|
|
|
2585
2588
|
}
|
|
2586
2589
|
def(res, '$stable', isStable);
|
|
2587
2590
|
def(res, '$key', key);
|
|
2591
|
+
def(res, '$hasNormal', hasNormalSlots);
|
|
2588
2592
|
return res
|
|
2589
2593
|
}
|
|
2590
2594
|
|
|
@@ -2594,8 +2598,10 @@
|
|
|
2594
2598
|
res = res && typeof res === 'object' && !Array.isArray(res)
|
|
2595
2599
|
? [res] // single vnode
|
|
2596
2600
|
: normalizeChildren(res);
|
|
2597
|
-
return res &&
|
|
2598
|
-
|
|
2601
|
+
return res && (
|
|
2602
|
+
res.length === 0 ||
|
|
2603
|
+
(res.length === 1 && res[0].isComment) // #9658
|
|
2604
|
+
) ? undefined
|
|
2599
2605
|
: res
|
|
2600
2606
|
};
|
|
2601
2607
|
// this is a slot using the new v-slot syntax without scope. although it is
|
|
@@ -2775,12 +2781,13 @@
|
|
|
2775
2781
|
: data.attrs || (data.attrs = {});
|
|
2776
2782
|
}
|
|
2777
2783
|
var camelizedKey = camelize(key);
|
|
2778
|
-
|
|
2784
|
+
var hyphenatedKey = hyphenate(key);
|
|
2785
|
+
if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
|
|
2779
2786
|
hash[key] = value[key];
|
|
2780
2787
|
|
|
2781
2788
|
if (isSync) {
|
|
2782
2789
|
var on = data.on || (data.on = {});
|
|
2783
|
-
on[("update:" +
|
|
2790
|
+
on[("update:" + key)] = function ($event) {
|
|
2784
2791
|
value[key] = $event;
|
|
2785
2792
|
};
|
|
2786
2793
|
}
|
|
@@ -2911,7 +2918,7 @@
|
|
|
2911
2918
|
if (typeof key === 'string' && key) {
|
|
2912
2919
|
baseObj[values[i]] = values[i + 1];
|
|
2913
2920
|
} else if (key !== '' && key !== null) {
|
|
2914
|
-
// null is a
|
|
2921
|
+
// null is a special value for explicitly removing a binding
|
|
2915
2922
|
warn(
|
|
2916
2923
|
("Invalid value for dynamic directive argument (expected string or null): " + key),
|
|
2917
2924
|
this
|
|
@@ -3406,6 +3413,12 @@
|
|
|
3406
3413
|
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
|
|
3407
3414
|
if (config.isReservedTag(tag)) {
|
|
3408
3415
|
// platform built-in elements
|
|
3416
|
+
if (isDef(data) && isDef(data.nativeOn)) {
|
|
3417
|
+
warn(
|
|
3418
|
+
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
|
|
3419
|
+
context
|
|
3420
|
+
);
|
|
3421
|
+
}
|
|
3409
3422
|
vnode = new VNode(
|
|
3410
3423
|
config.parsePlatformTagName(tag), data, children,
|
|
3411
3424
|
undefined, undefined, context
|
|
@@ -3531,7 +3544,7 @@
|
|
|
3531
3544
|
// render self
|
|
3532
3545
|
var vnode;
|
|
3533
3546
|
try {
|
|
3534
|
-
// There's no need to maintain a stack
|
|
3547
|
+
// There's no need to maintain a stack because all render fns are called
|
|
3535
3548
|
// separately from one another. Nested component's render fns are called
|
|
3536
3549
|
// when parent component is patched.
|
|
3537
3550
|
currentRenderingInstance = vm;
|
|
@@ -3614,17 +3627,23 @@
|
|
|
3614
3627
|
return factory.resolved
|
|
3615
3628
|
}
|
|
3616
3629
|
|
|
3630
|
+
var owner = currentRenderingInstance;
|
|
3631
|
+
if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
|
|
3632
|
+
// already pending
|
|
3633
|
+
factory.owners.push(owner);
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3617
3636
|
if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
|
|
3618
3637
|
return factory.loadingComp
|
|
3619
3638
|
}
|
|
3620
3639
|
|
|
3621
|
-
|
|
3622
|
-
if (isDef(factory.owners)) {
|
|
3623
|
-
// already pending
|
|
3624
|
-
factory.owners.push(owner);
|
|
3625
|
-
} else {
|
|
3640
|
+
if (owner && !isDef(factory.owners)) {
|
|
3626
3641
|
var owners = factory.owners = [owner];
|
|
3627
3642
|
var sync = true;
|
|
3643
|
+
var timerLoading = null;
|
|
3644
|
+
var timerTimeout = null
|
|
3645
|
+
|
|
3646
|
+
;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
|
|
3628
3647
|
|
|
3629
3648
|
var forceRender = function (renderCompleted) {
|
|
3630
3649
|
for (var i = 0, l = owners.length; i < l; i++) {
|
|
@@ -3633,6 +3652,14 @@
|
|
|
3633
3652
|
|
|
3634
3653
|
if (renderCompleted) {
|
|
3635
3654
|
owners.length = 0;
|
|
3655
|
+
if (timerLoading !== null) {
|
|
3656
|
+
clearTimeout(timerLoading);
|
|
3657
|
+
timerLoading = null;
|
|
3658
|
+
}
|
|
3659
|
+
if (timerTimeout !== null) {
|
|
3660
|
+
clearTimeout(timerTimeout);
|
|
3661
|
+
timerTimeout = null;
|
|
3662
|
+
}
|
|
3636
3663
|
}
|
|
3637
3664
|
};
|
|
3638
3665
|
|
|
@@ -3679,7 +3706,8 @@
|
|
|
3679
3706
|
if (res.delay === 0) {
|
|
3680
3707
|
factory.loading = true;
|
|
3681
3708
|
} else {
|
|
3682
|
-
setTimeout(function () {
|
|
3709
|
+
timerLoading = setTimeout(function () {
|
|
3710
|
+
timerLoading = null;
|
|
3683
3711
|
if (isUndef(factory.resolved) && isUndef(factory.error)) {
|
|
3684
3712
|
factory.loading = true;
|
|
3685
3713
|
forceRender(false);
|
|
@@ -3689,7 +3717,8 @@
|
|
|
3689
3717
|
}
|
|
3690
3718
|
|
|
3691
3719
|
if (isDef(res.timeout)) {
|
|
3692
|
-
setTimeout(function () {
|
|
3720
|
+
timerTimeout = setTimeout(function () {
|
|
3721
|
+
timerTimeout = null;
|
|
3693
3722
|
if (isUndef(factory.resolved)) {
|
|
3694
3723
|
reject(
|
|
3695
3724
|
"timeout (" + (res.timeout) + "ms)"
|
|
@@ -4235,11 +4264,21 @@
|
|
|
4235
4264
|
// timestamp can either be hi-res (relative to page load) or low-res
|
|
4236
4265
|
// (relative to UNIX epoch), so in order to compare time we have to use the
|
|
4237
4266
|
// same timestamp type when saving the flush timestamp.
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4267
|
+
// All IE versions use low-res event timestamps, and have problematic clock
|
|
4268
|
+
// implementations (#9632)
|
|
4269
|
+
if (inBrowser && !isIE) {
|
|
4270
|
+
var performance = window.performance;
|
|
4271
|
+
if (
|
|
4272
|
+
performance &&
|
|
4273
|
+
typeof performance.now === 'function' &&
|
|
4274
|
+
getNow() > document.createEvent('Event').timeStamp
|
|
4275
|
+
) {
|
|
4276
|
+
// if the event timestamp, although evaluated AFTER the Date.now(), is
|
|
4277
|
+
// smaller than it, it means the event is using a hi-res timestamp,
|
|
4278
|
+
// and we need to use the hi-res version for event listener timestamps as
|
|
4279
|
+
// well.
|
|
4280
|
+
getNow = function () { return performance.now(); };
|
|
4281
|
+
}
|
|
4243
4282
|
}
|
|
4244
4283
|
|
|
4245
4284
|
/**
|
|
@@ -5404,7 +5443,7 @@
|
|
|
5404
5443
|
value: FunctionalRenderContext
|
|
5405
5444
|
});
|
|
5406
5445
|
|
|
5407
|
-
Vue.version = '2.6.
|
|
5446
|
+
Vue.version = '2.6.11';
|
|
5408
5447
|
|
|
5409
5448
|
/* */
|
|
5410
5449
|
|
|
@@ -6077,7 +6116,7 @@
|
|
|
6077
6116
|
}
|
|
6078
6117
|
}
|
|
6079
6118
|
|
|
6080
|
-
function removeVnodes (
|
|
6119
|
+
function removeVnodes (vnodes, startIdx, endIdx) {
|
|
6081
6120
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
6082
6121
|
var ch = vnodes[startIdx];
|
|
6083
6122
|
if (isDef(ch)) {
|
|
@@ -6188,7 +6227,7 @@
|
|
|
6188
6227
|
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
|
|
6189
6228
|
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
|
|
6190
6229
|
} else if (newStartIdx > newEndIdx) {
|
|
6191
|
-
removeVnodes(
|
|
6230
|
+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
6192
6231
|
}
|
|
6193
6232
|
}
|
|
6194
6233
|
|
|
@@ -6280,7 +6319,7 @@
|
|
|
6280
6319
|
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
|
|
6281
6320
|
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
|
|
6282
6321
|
} else if (isDef(oldCh)) {
|
|
6283
|
-
removeVnodes(
|
|
6322
|
+
removeVnodes(oldCh, 0, oldCh.length - 1);
|
|
6284
6323
|
} else if (isDef(oldVnode.text)) {
|
|
6285
6324
|
nodeOps.setTextContent(elm, '');
|
|
6286
6325
|
}
|
|
@@ -6509,7 +6548,7 @@
|
|
|
6509
6548
|
|
|
6510
6549
|
// destroy old node
|
|
6511
6550
|
if (isDef(parentElm)) {
|
|
6512
|
-
removeVnodes(
|
|
6551
|
+
removeVnodes([oldVnode], 0, 0);
|
|
6513
6552
|
} else if (isDef(oldVnode.tag)) {
|
|
6514
6553
|
invokeDestroyHook(oldVnode);
|
|
6515
6554
|
}
|
|
@@ -7496,8 +7535,10 @@
|
|
|
7496
7535
|
e.target === e.currentTarget ||
|
|
7497
7536
|
// event is fired after handler attachment
|
|
7498
7537
|
e.timeStamp >= attachedTimestamp ||
|
|
7499
|
-
//
|
|
7500
|
-
|
|
7538
|
+
// bail for environments that have buggy event.timeStamp implementations
|
|
7539
|
+
// #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
|
|
7540
|
+
// #9681 QtWebEngine event.timeStamp is negative value
|
|
7541
|
+
e.timeStamp <= 0 ||
|
|
7501
7542
|
// #9448 bail if event is fired in another document in a multi-page
|
|
7502
7543
|
// electron/nw.js app, since event.timeStamp will be using a different
|
|
7503
7544
|
// starting reference
|
|
@@ -7564,10 +7605,11 @@
|
|
|
7564
7605
|
}
|
|
7565
7606
|
|
|
7566
7607
|
for (key in oldProps) {
|
|
7567
|
-
if (
|
|
7608
|
+
if (!(key in props)) {
|
|
7568
7609
|
elm[key] = '';
|
|
7569
7610
|
}
|
|
7570
7611
|
}
|
|
7612
|
+
|
|
7571
7613
|
for (key in props) {
|
|
7572
7614
|
cur = props[key];
|
|
7573
7615
|
// ignore children if the node has textContent or innerHTML,
|
|
@@ -8115,8 +8157,8 @@
|
|
|
8115
8157
|
var context = activeInstance;
|
|
8116
8158
|
var transitionNode = activeInstance.$vnode;
|
|
8117
8159
|
while (transitionNode && transitionNode.parent) {
|
|
8118
|
-
transitionNode = transitionNode.parent;
|
|
8119
8160
|
context = transitionNode.context;
|
|
8161
|
+
transitionNode = transitionNode.parent;
|
|
8120
8162
|
}
|
|
8121
8163
|
|
|
8122
8164
|
var isAppear = !context._isMounted || !vnode.isRootInsert;
|
|
@@ -9206,13 +9248,13 @@
|
|
|
9206
9248
|
// Regular Expressions for parsing tags and attributes
|
|
9207
9249
|
var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
|
|
9208
9250
|
var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
|
|
9209
|
-
var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" +
|
|
9251
|
+
var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
|
|
9210
9252
|
var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
|
|
9211
9253
|
var startTagOpen = new RegExp(("^<" + qnameCapture));
|
|
9212
9254
|
var startTagClose = /^\s*(\/?)>/;
|
|
9213
9255
|
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
|
|
9214
9256
|
var doctype = /^<!DOCTYPE [^>]+>/i;
|
|
9215
|
-
// #7298: escape - to avoid being
|
|
9257
|
+
// #7298: escape - to avoid being passed as HTML comment when inlined in page
|
|
9216
9258
|
var comment = /^<!\--/;
|
|
9217
9259
|
var conditionalComment = /^<!\[/;
|
|
9218
9260
|
|
|
@@ -9468,7 +9510,7 @@
|
|
|
9468
9510
|
) {
|
|
9469
9511
|
options.warn(
|
|
9470
9512
|
("tag <" + (stack[i].tag) + "> has no matching end tag."),
|
|
9471
|
-
{ start: stack[i].start }
|
|
9513
|
+
{ start: stack[i].start, end: stack[i].end }
|
|
9472
9514
|
);
|
|
9473
9515
|
}
|
|
9474
9516
|
if (options.end) {
|
|
@@ -9497,7 +9539,7 @@
|
|
|
9497
9539
|
/* */
|
|
9498
9540
|
|
|
9499
9541
|
var onRE = /^@|^v-on:/;
|
|
9500
|
-
var dirRE = /^v
|
|
9542
|
+
var dirRE = /^v-|^@|^:|^#/;
|
|
9501
9543
|
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
|
|
9502
9544
|
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
|
|
9503
9545
|
var stripParensRE = /^\(|\)$/g;
|
|
@@ -9505,7 +9547,7 @@
|
|
|
9505
9547
|
|
|
9506
9548
|
var argRE = /:(.*)$/;
|
|
9507
9549
|
var bindRE = /^:|^\.|^v-bind:/;
|
|
9508
|
-
var modifierRE = /\.[
|
|
9550
|
+
var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
|
|
9509
9551
|
|
|
9510
9552
|
var slotRE = /^v-slot(:|$)|^#/;
|
|
9511
9553
|
|
|
@@ -9682,7 +9724,7 @@
|
|
|
9682
9724
|
shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
|
|
9683
9725
|
shouldKeepComment: options.comments,
|
|
9684
9726
|
outputSourceRange: options.outputSourceRange,
|
|
9685
|
-
start: function start (tag, attrs, unary, start$1) {
|
|
9727
|
+
start: function start (tag, attrs, unary, start$1, end) {
|
|
9686
9728
|
// check namespace.
|
|
9687
9729
|
// inherit parent ns if there is one
|
|
9688
9730
|
var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
|
|
@@ -9701,6 +9743,7 @@
|
|
|
9701
9743
|
{
|
|
9702
9744
|
if (options.outputSourceRange) {
|
|
9703
9745
|
element.start = start$1;
|
|
9746
|
+
element.end = end;
|
|
9704
9747
|
element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
|
|
9705
9748
|
cumulated[attr.name] = attr;
|
|
9706
9749
|
return cumulated
|
|
@@ -9822,7 +9865,7 @@
|
|
|
9822
9865
|
text = preserveWhitespace ? ' ' : '';
|
|
9823
9866
|
}
|
|
9824
9867
|
if (text) {
|
|
9825
|
-
if (whitespaceOption === 'condense') {
|
|
9868
|
+
if (!inPre && whitespaceOption === 'condense') {
|
|
9826
9869
|
// condense consecutive whitespaces into single space
|
|
9827
9870
|
text = text.replace(whitespaceRE$1, ' ');
|
|
9828
9871
|
}
|
|
@@ -10120,7 +10163,7 @@
|
|
|
10120
10163
|
if (el.parent && !maybeComponent(el.parent)) {
|
|
10121
10164
|
warn$2(
|
|
10122
10165
|
"<template v-slot> can only appear at the root level inside " +
|
|
10123
|
-
"the receiving
|
|
10166
|
+
"the receiving component",
|
|
10124
10167
|
el
|
|
10125
10168
|
);
|
|
10126
10169
|
}
|
|
@@ -10683,7 +10726,7 @@
|
|
|
10683
10726
|
|
|
10684
10727
|
/* */
|
|
10685
10728
|
|
|
10686
|
-
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
|
|
10729
|
+
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
|
|
10687
10730
|
var fnInvokeRE = /\([^)]*?\);*$/;
|
|
10688
10731
|
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
|
|
10689
10732
|
|
|
@@ -11185,7 +11228,7 @@
|
|
|
11185
11228
|
// components with only scoped slots to skip forced updates from parent.
|
|
11186
11229
|
// but in some cases we have to bail-out of this optimization
|
|
11187
11230
|
// for example if the slot contains dynamic names, has v-if or v-for on them...
|
|
11188
|
-
var needsForceUpdate = Object.keys(slots).some(function (key) {
|
|
11231
|
+
var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
|
|
11189
11232
|
var slot = slots[key];
|
|
11190
11233
|
return (
|
|
11191
11234
|
slot.slotTargetDynamic ||
|
|
@@ -11452,6 +11495,8 @@
|
|
|
11452
11495
|
var range = node.rawAttrsMap[name];
|
|
11453
11496
|
if (name === 'v-for') {
|
|
11454
11497
|
checkFor(node, ("v-for=\"" + value + "\""), warn, range);
|
|
11498
|
+
} else if (name === 'v-slot' || name[0] === '#') {
|
|
11499
|
+
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
|
|
11455
11500
|
} else if (onRE.test(name)) {
|
|
11456
11501
|
checkEvent(value, (name + "=\"" + value + "\""), warn, range);
|
|
11457
11502
|
} else {
|
|
@@ -11471,9 +11516,9 @@
|
|
|
11471
11516
|
}
|
|
11472
11517
|
|
|
11473
11518
|
function checkEvent (exp, text, warn, range) {
|
|
11474
|
-
var
|
|
11475
|
-
var keywordMatch =
|
|
11476
|
-
if (keywordMatch &&
|
|
11519
|
+
var stripped = exp.replace(stripStringRE, '');
|
|
11520
|
+
var keywordMatch = stripped.match(unaryOperatorsRE);
|
|
11521
|
+
if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
|
|
11477
11522
|
warn(
|
|
11478
11523
|
"avoid using JavaScript unary operator as property name: " +
|
|
11479
11524
|
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
|
|
@@ -11528,6 +11573,19 @@
|
|
|
11528
11573
|
}
|
|
11529
11574
|
}
|
|
11530
11575
|
|
|
11576
|
+
function checkFunctionParameterExpression (exp, text, warn, range) {
|
|
11577
|
+
try {
|
|
11578
|
+
new Function(exp, '');
|
|
11579
|
+
} catch (e) {
|
|
11580
|
+
warn(
|
|
11581
|
+
"invalid function parameter expression: " + (e.message) + " in\n\n" +
|
|
11582
|
+
" " + exp + "\n\n" +
|
|
11583
|
+
" Raw expression: " + (text.trim()) + "\n",
|
|
11584
|
+
range
|
|
11585
|
+
);
|
|
11586
|
+
}
|
|
11587
|
+
}
|
|
11588
|
+
|
|
11531
11589
|
/* */
|
|
11532
11590
|
|
|
11533
11591
|
var range = 2;
|