Skip to content

Commit dfb9fb1

Browse files
committed
build: build 2.6.4
1 parent b2a093f commit dfb9fb1

19 files changed

+521
-139
lines changed

Diff for: dist/vue.common.dev.js

+59-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.3
2+
* Vue.js v2.6.4
33
* (c) 2014-2019 Evan You
44
* Released under the MIT License.
55
*/
@@ -1864,7 +1864,11 @@ function globalHandleError (err, vm, info) {
18641864
try {
18651865
return config.errorHandler.call(null, err, vm, info)
18661866
} catch (e) {
1867-
logError(e, null, 'config.errorHandler');
1867+
// if the user intentionally throws the original error in the handler,
1868+
// do not log it twice
1869+
if (e !== err) {
1870+
logError(e, null, 'config.errorHandler');
1871+
}
18681872
}
18691873
}
18701874
logError(err, vm, info);
@@ -2526,18 +2530,23 @@ function isWhitespace (node) {
25262530

25272531
function normalizeScopedSlots (
25282532
slots,
2529-
normalSlots
2533+
normalSlots,
2534+
prevSlots
25302535
) {
25312536
var res;
25322537
if (!slots) {
25332538
res = {};
25342539
} else if (slots._normalized) {
2535-
return slots
2540+
// fast path 1: child component re-render only, parent did not change
2541+
return slots._normalized
2542+
} else if (slots.$stable && prevSlots && prevSlots !== emptyObject) {
2543+
// fast path 2: stable scoped slots, only need to normalize once
2544+
return prevSlots
25362545
} else {
25372546
res = {};
25382547
for (var key in slots) {
25392548
if (slots[key] && key[0] !== '$') {
2540-
res[key] = normalizeScopedSlot(slots[key]);
2549+
res[key] = normalizeScopedSlot(normalSlots, key, slots[key]);
25412550
}
25422551
}
25432552
}
@@ -2547,18 +2556,36 @@ function normalizeScopedSlots (
25472556
res[key$1] = proxyNormalSlot(normalSlots, key$1);
25482557
}
25492558
}
2550-
def(res, '_normalized', true);
2559+
// avoriaz seems to mock a non-extensible $scopedSlots object
2560+
// and when that is passed down this would cause an error
2561+
if (slots && Object.isExtensible(slots)) {
2562+
(slots)._normalized = res;
2563+
}
25512564
def(res, '$stable', slots ? !!slots.$stable : true);
25522565
return res
25532566
}
25542567

2555-
function normalizeScopedSlot(fn) {
2556-
return function (scope) {
2557-
var res = fn(scope);
2558-
return res && typeof res === 'object' && !Array.isArray(res)
2568+
function normalizeScopedSlot(normalSlots, key, fn) {
2569+
var normalized = function (scope) {
2570+
var res = fn(scope || {});
2571+
res = res && typeof res === 'object' && !Array.isArray(res)
25592572
? [res] // single vnode
2560-
: normalizeChildren(res)
2573+
: normalizeChildren(res);
2574+
return res && res.length === 0
2575+
? undefined
2576+
: res
2577+
};
2578+
// this is a slot using the new v-slot syntax without scope. although it is
2579+
// compiled as a scoped slot, render fn users would expect it to be present
2580+
// on this.$slots because the usage is semantically a normal slot.
2581+
if (fn.proxy) {
2582+
Object.defineProperty(normalSlots, key, {
2583+
get: normalized,
2584+
enumerable: true,
2585+
configurable: true
2586+
});
25612587
}
2588+
return normalized
25622589
}
25632590

25642591
function proxyNormalSlot(slots, key) {
@@ -2838,6 +2865,10 @@ function resolveScopedSlots (
28382865
if (Array.isArray(slot)) {
28392866
resolveScopedSlots(slot, hasDynamicKeys, res);
28402867
} else if (slot) {
2868+
// marker for reverse proxying v-slot without scope on this.$slots
2869+
if (slot.proxy) {
2870+
slot.fn.proxy = true;
2871+
}
28412872
res[slot.key] = slot.fn;
28422873
}
28432874
}
@@ -2900,6 +2931,8 @@ function FunctionalRenderContext (
29002931
parent,
29012932
Ctor
29022933
) {
2934+
var this$1 = this;
2935+
29032936
var options = Ctor.options;
29042937
// ensure the createElement function in functional components
29052938
// gets a unique context - this is necessary for correct named slot check
@@ -2925,7 +2958,15 @@ function FunctionalRenderContext (
29252958
this.parent = parent;
29262959
this.listeners = data.on || emptyObject;
29272960
this.injections = resolveInject(options.inject, parent);
2928-
this.slots = function () { return resolveSlots(children, parent); };
2961+
this.slots = function () {
2962+
if (!this$1.$slots) {
2963+
normalizeScopedSlots(
2964+
data.scopedSlots,
2965+
this$1.$slots = resolveSlots(children, parent)
2966+
);
2967+
}
2968+
return this$1.$slots
2969+
};
29292970

29302971
Object.defineProperty(this, 'scopedSlots', ({
29312972
enumerable: true,
@@ -3451,7 +3492,8 @@ function renderMixin (Vue) {
34513492
if (_parentVnode) {
34523493
vm.$scopedSlots = normalizeScopedSlots(
34533494
_parentVnode.data.scopedSlots,
3454-
vm.$slots
3495+
vm.$slots,
3496+
vm.$scopedSlots
34553497
);
34563498
}
34573499

@@ -5331,7 +5373,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
53315373
value: FunctionalRenderContext
53325374
});
53335375

5334-
Vue.version = '2.6.3';
5376+
Vue.version = '2.6.4';
53355377

53365378
/* */
53375379

@@ -11138,7 +11180,9 @@ function genScopedSlot (
1113811180
? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
1113911181
: genChildren(el, state) || 'undefined'
1114011182
: genElement(el, state)) + "}";
11141-
return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + "}")
11183+
// reverse proxy v-slot without scope on this.$slots
11184+
var reverseProxy = slotScope ? "" : ",proxy:true";
11185+
return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
1114211186
}
1114311187

1114411188
function genChildren (

Diff for: dist/vue.common.prod.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/vue.esm.browser.js

+57-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.6.3
2+
* Vue.js v2.6.4
33
* (c) 2014-2019 Evan You
44
* Released under the MIT License.
55
*/
@@ -1895,7 +1895,11 @@ function globalHandleError (err, vm, info) {
18951895
try {
18961896
return config.errorHandler.call(null, err, vm, info)
18971897
} catch (e) {
1898-
logError(e, null, 'config.errorHandler');
1898+
// if the user intentionally throws the original error in the handler,
1899+
// do not log it twice
1900+
if (e !== err) {
1901+
logError(e, null, 'config.errorHandler');
1902+
}
18991903
}
19001904
}
19011905
logError(err, vm, info);
@@ -2554,18 +2558,23 @@ function isWhitespace (node) {
25542558

25552559
function normalizeScopedSlots (
25562560
slots,
2557-
normalSlots
2561+
normalSlots,
2562+
prevSlots
25582563
) {
25592564
let res;
25602565
if (!slots) {
25612566
res = {};
25622567
} else if (slots._normalized) {
2563-
return slots
2568+
// fast path 1: child component re-render only, parent did not change
2569+
return slots._normalized
2570+
} else if (slots.$stable && prevSlots && prevSlots !== emptyObject) {
2571+
// fast path 2: stable scoped slots, only need to normalize once
2572+
return prevSlots
25642573
} else {
25652574
res = {};
25662575
for (const key in slots) {
25672576
if (slots[key] && key[0] !== '$') {
2568-
res[key] = normalizeScopedSlot(slots[key]);
2577+
res[key] = normalizeScopedSlot(normalSlots, key, slots[key]);
25692578
}
25702579
}
25712580
}
@@ -2575,18 +2584,36 @@ function normalizeScopedSlots (
25752584
res[key] = proxyNormalSlot(normalSlots, key);
25762585
}
25772586
}
2578-
def(res, '_normalized', true);
2587+
// avoriaz seems to mock a non-extensible $scopedSlots object
2588+
// and when that is passed down this would cause an error
2589+
if (slots && Object.isExtensible(slots)) {
2590+
(slots)._normalized = res;
2591+
}
25792592
def(res, '$stable', slots ? !!slots.$stable : true);
25802593
return res
25812594
}
25822595

2583-
function normalizeScopedSlot(fn) {
2584-
return scope => {
2585-
const res = fn(scope);
2586-
return res && typeof res === 'object' && !Array.isArray(res)
2596+
function normalizeScopedSlot(normalSlots, key, fn) {
2597+
const normalized = scope => {
2598+
let res = fn(scope || {});
2599+
res = res && typeof res === 'object' && !Array.isArray(res)
25872600
? [res] // single vnode
2588-
: normalizeChildren(res)
2601+
: normalizeChildren(res);
2602+
return res && res.length === 0
2603+
? undefined
2604+
: res
2605+
};
2606+
// this is a slot using the new v-slot syntax without scope. although it is
2607+
// compiled as a scoped slot, render fn users would expect it to be present
2608+
// on this.$slots because the usage is semantically a normal slot.
2609+
if (fn.proxy) {
2610+
Object.defineProperty(normalSlots, key, {
2611+
get: normalized,
2612+
enumerable: true,
2613+
configurable: true
2614+
});
25892615
}
2616+
return normalized
25902617
}
25912618

25922619
function proxyNormalSlot(slots, key) {
@@ -2864,6 +2891,10 @@ function resolveScopedSlots (
28642891
if (Array.isArray(slot)) {
28652892
resolveScopedSlots(slot, hasDynamicKeys, res);
28662893
} else if (slot) {
2894+
// marker for reverse proxying v-slot without scope on this.$slots
2895+
if (slot.proxy) {
2896+
slot.fn.proxy = true;
2897+
}
28672898
res[slot.key] = slot.fn;
28682899
}
28692900
}
@@ -2951,7 +2982,15 @@ function FunctionalRenderContext (
29512982
this.parent = parent;
29522983
this.listeners = data.on || emptyObject;
29532984
this.injections = resolveInject(options.inject, parent);
2954-
this.slots = () => resolveSlots(children, parent);
2985+
this.slots = () => {
2986+
if (!this.$slots) {
2987+
normalizeScopedSlots(
2988+
data.scopedSlots,
2989+
this.$slots = resolveSlots(children, parent)
2990+
);
2991+
}
2992+
return this.$slots
2993+
};
29552994

29562995
Object.defineProperty(this, 'scopedSlots', ({
29572996
enumerable: true,
@@ -3474,7 +3513,8 @@ function renderMixin (Vue) {
34743513
if (_parentVnode) {
34753514
vm.$scopedSlots = normalizeScopedSlots(
34763515
_parentVnode.data.scopedSlots,
3477-
vm.$slots
3516+
vm.$slots,
3517+
vm.$scopedSlots
34783518
);
34793519
}
34803520

@@ -5364,7 +5404,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
53645404
value: FunctionalRenderContext
53655405
});
53665406

5367-
Vue.version = '2.6.3';
5407+
Vue.version = '2.6.4';
53685408

53695409
/* */
53705410

@@ -11202,7 +11242,9 @@ function genScopedSlot (
1120211242
: genChildren(el, state) || 'undefined'
1120311243
: genElement(el, state)
1120411244
}}`;
11205-
return `{key:${el.slotTarget || `"default"`},fn:${fn}}`
11245+
// reverse proxy v-slot without scope on this.$slots
11246+
const reverseProxy = slotScope ? `` : `,proxy:true`;
11247+
return `{key:${el.slotTarget || `"default"`},fn:${fn}${reverseProxy}}`
1120611248
}
1120711249

1120811250
function genChildren (

Diff for: dist/vue.esm.browser.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)