Skip to content

Commit f34f6bb

Browse files
committedJun 1, 2021
build: build 2.6.13
1 parent f038000 commit f34f6bb

19 files changed

+1025
-631
lines changed
 

‎dist/vue.common.dev.js

+125-76
Large diffs are not rendered by default.

‎dist/vue.common.prod.js

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

‎dist/vue.esm.browser.js

+119-76
Large diffs are not rendered by default.

‎dist/vue.esm.browser.min.js

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

‎dist/vue.esm.js

+125-76
Large diffs are not rendered by default.

‎dist/vue.js

+125-76
Large diffs are not rendered by default.

‎dist/vue.min.js

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

‎dist/vue.runtime.common.dev.js

+112-68
Large diffs are not rendered by default.

‎dist/vue.runtime.common.prod.js

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

‎dist/vue.runtime.esm.js

+112-68
Large diffs are not rendered by default.

‎dist/vue.runtime.js

+112-68
Large diffs are not rendered by default.

‎dist/vue.runtime.min.js

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

‎packages/vue-server-renderer/basic.js

+71-42
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@
465465
'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
466466
'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
467467
'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
468-
'required,reversed,scoped,seamless,selected,sortable,translate,' +
468+
'required,reversed,scoped,seamless,selected,sortable,' +
469469
'truespeed,typemustmatch,visible'
470470
);
471471

@@ -483,6 +483,10 @@
483483
if (isUndef(opts) || opts.Ctor.options.inheritAttrs !== false) {
484484
var parent = node.parent;
485485
while (isDef(parent)) {
486+
// Stop fallthrough in case parent has inheritAttrs option set to false
487+
if (parent.componentOptions && parent.componentOptions.Ctor.options.inheritAttrs === false) {
488+
break;
489+
}
486490
if (isDef(parent.data) && isDef(parent.data.attrs)) {
487491
attrs = extend(extend({}, attrs), parent.data.attrs);
488492
}
@@ -635,7 +639,7 @@
635639
} else if (key === 'textContent') {
636640
setText(node, props[key], false);
637641
} else if (key === 'value' && node.tag === 'textarea') {
638-
setText(node, props[key], false);
642+
setText(node, toString(props[key]), false);
639643
} else {
640644
// $flow-disable-line (WTF?)
641645
var attr = propsToAttrMap[key] || key.toLowerCase();
@@ -1849,13 +1853,14 @@
18491853
type = [type];
18501854
}
18511855
for (var i = 0; i < type.length && !valid; i++) {
1852-
var assertedType = assertType(value, type[i]);
1856+
var assertedType = assertType(value, type[i], vm);
18531857
expectedTypes.push(assertedType.expectedType || '');
18541858
valid = assertedType.valid;
18551859
}
18561860
}
18571861

1858-
if (!valid) {
1862+
var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
1863+
if (!valid && haveExpectedTypes) {
18591864
warn(
18601865
getInvalidTypeMessage(name, value, expectedTypes),
18611866
vm
@@ -1873,9 +1878,9 @@
18731878
}
18741879
}
18751880

1876-
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
1881+
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
18771882

1878-
function assertType (value, type) {
1883+
function assertType (value, type, vm) {
18791884
var valid;
18801885
var expectedType = getType(type);
18811886
if (simpleCheckRE.test(expectedType)) {
@@ -1890,21 +1895,28 @@
18901895
} else if (expectedType === 'Array') {
18911896
valid = Array.isArray(value);
18921897
} else {
1893-
valid = value instanceof type;
1898+
try {
1899+
valid = value instanceof type;
1900+
} catch (e) {
1901+
warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
1902+
valid = false;
1903+
}
18941904
}
18951905
return {
18961906
valid: valid,
18971907
expectedType: expectedType
18981908
}
18991909
}
19001910

1911+
var functionTypeCheckRE = /^\s*function (\w+)/;
1912+
19011913
/**
19021914
* Use function string name to check built-in types,
19031915
* because a simple equality check will fail when running
19041916
* across different vms / iframes.
19051917
*/
19061918
function getType (fn) {
1907-
var match = fn && fn.toString().match(/^\s*function (\w+)/);
1919+
var match = fn && fn.toString().match(functionTypeCheckRE);
19081920
return match ? match[1] : ''
19091921
}
19101922

@@ -1929,18 +1941,19 @@
19291941
" Expected " + (expectedTypes.map(capitalize).join(', '));
19301942
var expectedType = expectedTypes[0];
19311943
var receivedType = toRawType(value);
1932-
var expectedValue = styleValue(value, expectedType);
1933-
var receivedValue = styleValue(value, receivedType);
19341944
// check if we need to specify expected value
1935-
if (expectedTypes.length === 1 &&
1936-
isExplicable(expectedType) &&
1937-
!isBoolean(expectedType, receivedType)) {
1938-
message += " with value " + expectedValue;
1945+
if (
1946+
expectedTypes.length === 1 &&
1947+
isExplicable(expectedType) &&
1948+
isExplicable(typeof value) &&
1949+
!isBoolean(expectedType, receivedType)
1950+
) {
1951+
message += " with value " + (styleValue(value, expectedType));
19391952
}
19401953
message += ", got " + receivedType + " ";
19411954
// check if we need to specify received value
19421955
if (isExplicable(receivedType)) {
1943-
message += "with value " + receivedValue + ".";
1956+
message += "with value " + (styleValue(value, receivedType)) + ".";
19441957
}
19451958
return message
19461959
}
@@ -1955,9 +1968,9 @@
19551968
}
19561969
}
19571970

1971+
var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
19581972
function isExplicable (value) {
1959-
var explicitTypes = ['string', 'number', 'boolean'];
1960-
return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
1973+
return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; })
19611974
}
19621975

19631976
function isBoolean () {
@@ -2172,7 +2185,7 @@
21722185
// contain child elements.
21732186
var isSVG = makeMap(
21742187
'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
2175-
'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
2188+
'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
21762189
'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
21772190
true
21782191
);
@@ -3366,7 +3379,7 @@
33663379

33673380
// Regular Expressions for parsing tags and attributes
33683381
var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
3369-
var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
3382+
var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
33703383
var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
33713384
var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
33723385
var startTagOpen = new RegExp(("^<" + qnameCapture));
@@ -3819,7 +3832,7 @@
38193832
var slotRE = /^v-slot(:|$)|^#/;
38203833

38213834
var lineBreakRE = /[\r\n]/;
3822-
var whitespaceRE = /\s+/g;
3835+
var whitespaceRE = /[ \f\t\r\n]+/g;
38233836

38243837
var invalidAttributeRE = /[\s"'<>\/=]/;
38253838

@@ -3867,8 +3880,12 @@
38673880
platformMustUseProp = options.mustUseProp || no;
38683881
platformGetTagNamespace = options.getTagNamespace || no;
38693882
var isReservedTag = options.isReservedTag || no;
3870-
maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
3871-
3883+
maybeComponent = function (el) { return !!(
3884+
el.component ||
3885+
el.attrsMap[':is'] ||
3886+
el.attrsMap['v-bind:is'] ||
3887+
!(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag))
3888+
); };
38723889
transforms = pluckModuleFunction(options.modules, 'transformNode');
38733890
preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
38743891
postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
@@ -5156,9 +5173,9 @@
51565173
code += genModifierCode;
51575174
}
51585175
var handlerCode = isMethodPath
5159-
? ("return " + (handler.value) + "($event)")
5176+
? ("return " + (handler.value) + ".apply(null, arguments)")
51605177
: isFunctionExpression
5161-
? ("return (" + (handler.value) + ")($event)")
5178+
? ("return (" + (handler.value) + ").apply(null, arguments)")
51625179
: isFunctionInvocation
51635180
? ("return " + (handler.value))
51645181
: handler.value;
@@ -5244,7 +5261,8 @@
52445261
options
52455262
) {
52465263
var state = new CodegenState(options);
5247-
var code = ast ? genElement(ast, state) : '_c("div")';
5264+
// fix #11483, Root level <script> tags should not be rendered.
5265+
var code = ast ? (ast.tag === 'script' ? 'null' : genElement(ast, state)) : '_c("div")';
52485266
return {
52495267
render: ("with(this){return " + code + "}"),
52505268
staticRenderFns: state.staticRenderFns
@@ -5706,7 +5724,7 @@
57065724
function genSlot (el, state) {
57075725
var slotName = el.slotName || '"default"';
57085726
var children = genChildren(el, state);
5709-
var res = "_t(" + slotName + (children ? ("," + children) : '');
5727+
var res = "_t(" + slotName + (children ? (",function(){return " + children + "}") : '');
57105728
var attrs = el.attrs || el.dynamicAttrs
57115729
? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
57125730
// slot props are camelized
@@ -6840,7 +6858,7 @@
68406858
var allowedGlobals = makeMap(
68416859
'Infinity,undefined,NaN,isFinite,isNaN,' +
68426860
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
6843-
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
6861+
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
68446862
'require' // for Webpack/Browserify
68456863
);
68466864

@@ -7243,26 +7261,28 @@
72437261
*/
72447262
function renderSlot (
72457263
name,
7246-
fallback,
7264+
fallbackRender,
72477265
props,
72487266
bindObject
72497267
) {
72507268
var scopedSlotFn = this.$scopedSlots[name];
72517269
var nodes;
7252-
if (scopedSlotFn) { // scoped slot
7270+
if (scopedSlotFn) {
7271+
// scoped slot
72537272
props = props || {};
72547273
if (bindObject) {
72557274
if (!isObject(bindObject)) {
7256-
warn(
7257-
'slot v-bind without argument expects an Object',
7258-
this
7259-
);
7275+
warn('slot v-bind without argument expects an Object', this);
72607276
}
72617277
props = extend(extend({}, bindObject), props);
72627278
}
7263-
nodes = scopedSlotFn(props) || fallback;
7279+
nodes =
7280+
scopedSlotFn(props) ||
7281+
(typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
72647282
} else {
7265-
nodes = this.$slots[name] || fallback;
7283+
nodes =
7284+
this.$slots[name] ||
7285+
(typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
72667286
}
72677287

72687288
var target = props && props.slot;
@@ -7312,6 +7332,7 @@
73127332
} else if (eventKeyName) {
73137333
return hyphenate(eventKeyName) !== key
73147334
}
7335+
return eventKeyCode === undefined
73157336
}
73167337

73177338
/* */
@@ -7580,6 +7601,12 @@
75807601

75817602
/* */
75827603

7604+
function isAsyncPlaceholder (node) {
7605+
return node.isComment && node.asyncFactory
7606+
}
7607+
7608+
/* */
7609+
75837610
function normalizeScopedSlots (
75847611
slots,
75857612
normalSlots,
@@ -7636,9 +7663,10 @@
76367663
res = res && typeof res === 'object' && !Array.isArray(res)
76377664
? [res] // single vnode
76387665
: normalizeChildren(res);
7666+
var vnode = res && res[0];
76397667
return res && (
7640-
res.length === 0 ||
7641-
(res.length === 1 && res[0].isComment) // #9658
7668+
!vnode ||
7669+
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
76427670
) ? undefined
76437671
: res
76447672
};
@@ -7818,8 +7846,6 @@
78187846

78197847
/* */
78207848

7821-
/* */
7822-
78237849
var target;
78247850

78257851
function add (event, fn) {
@@ -7873,7 +7899,8 @@
78737899
var hasDynamicScopedSlot = !!(
78747900
(newScopedSlots && !newScopedSlots.$stable) ||
78757901
(oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
7876-
(newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
7902+
(newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
7903+
(!newScopedSlots && vm.$scopedSlots.$key)
78777904
);
78787905

78797906
// Any static slot children from the parent may have changed during parent's
@@ -8417,8 +8444,10 @@
84178444
}
84188445

84198446
function createComponentInstanceForVnode (
8420-
vnode, // we know it's MountedComponentVNode but flow doesn't
8421-
parent // activeInstance in lifecycle state
8447+
// we know it's MountedComponentVNode but flow doesn't
8448+
vnode,
8449+
// activeInstance in lifecycle state
8450+
parent
84228451
) {
84238452
var options = {
84248453
_isComponent: true,

0 commit comments

Comments
 (0)
Please sign in to comment.