Browse Source

build: build 2.5.7

dev
Evan You 7 years ago
parent
commit
c0d03ab127
  1. 52
      dist/vue.common.js
  2. 52
      dist/vue.esm.js
  3. 52
      dist/vue.js
  4. 4
      dist/vue.min.js
  5. 25
      dist/vue.runtime.common.js
  6. 25
      dist/vue.runtime.esm.js
  7. 25
      dist/vue.runtime.js
  8. 4
      dist/vue.runtime.min.js
  9. 29
      packages/vue-server-renderer/basic.js
  10. 31
      packages/vue-server-renderer/build.js
  11. 2
      packages/vue-server-renderer/package.json
  12. 27
      packages/vue-template-compiler/browser.js
  13. 27
      packages/vue-template-compiler/build.js
  14. 2
      packages/vue-template-compiler/package.json

52
dist/vue.common.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.5.6 * Vue.js v2.5.7
* (c) 2014-2017 Evan You * (c) 2014-2017 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1933,7 +1933,7 @@ function traverse (val) {
function _traverse (val, seen) { function _traverse (val, seen) {
var i, keys; var i, keys;
var isA = Array.isArray(val); var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { if ((!isA && !isObject(val)) || Object.isFrozen(val)) {
return return
} }
if (val.__ob__) { if (val.__ob__) {
@ -4870,16 +4870,21 @@ var KeepAlive = {
if (componentOptions) { if (componentOptions) {
// check pattern // check pattern
var name = getComponentName(componentOptions); var name = getComponentName(componentOptions);
if (!name || ( var ref = this;
(this.exclude && matches(this.exclude, name)) || var include = ref.include;
(this.include && !matches(this.include, name)) var exclude = ref.exclude;
)) { if (
// not included
(include && (!name || !matches(include, name))) ||
// excluded
(exclude && name && matches(exclude, name))
) {
return vnode return vnode
} }
var ref = this; var ref$1 = this;
var cache = ref.cache; var cache = ref$1.cache;
var keys = ref.keys; var keys = ref$1.keys;
var key = vnode.key == null var key = vnode.key == null
// same constructor may get registered as different local components // same constructor may get registered as different local components
// so cid alone is not enough (#3269) // so cid alone is not enough (#3269)
@ -4968,7 +4973,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
} }
}); });
Vue$3.version = '2.5.6'; Vue$3.version = '2.5.7';
/* */ /* */
@ -9262,6 +9267,15 @@ function processSlot (el) {
} }
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) {
warn$2(
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
"(v-for takes higher priority). Use a wrapper <template> for the " +
"scoped slot to make it clearer.",
true
);
}
el.slotScope = slotScope; el.slotScope = slotScope;
} }
var slotTarget = getBindingAttr(el, 'slot'); var slotTarget = getBindingAttr(el, 'slot');
@ -10302,9 +10316,6 @@ var unaryOperatorsRE = new RegExp('\\b' + (
'delete,typeof,void' 'delete,typeof,void'
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
// check valid identifier for v-for
var identRE = /[A-Za-z_$][\w$]*/;
// strip strings in expressions // strip strings in expressions
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
@ -10362,9 +10373,18 @@ function checkFor (node, text, errors) {
checkIdentifier(node.iterator2, 'v-for iterator', text, errors); checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
} }
function checkIdentifier (ident, type, text, errors) { function checkIdentifier (
if (typeof ident === 'string' && !identRE.test(ident)) { ident,
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); type,
text,
errors
) {
if (typeof ident === 'string') {
try {
new Function(("var " + ident));
} catch (e) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
} }
} }

52
dist/vue.esm.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.5.6 * Vue.js v2.5.7
* (c) 2014-2017 Evan You * (c) 2014-2017 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1931,7 +1931,7 @@ function traverse (val) {
function _traverse (val, seen) { function _traverse (val, seen) {
var i, keys; var i, keys;
var isA = Array.isArray(val); var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { if ((!isA && !isObject(val)) || Object.isFrozen(val)) {
return return
} }
if (val.__ob__) { if (val.__ob__) {
@ -4868,16 +4868,21 @@ var KeepAlive = {
if (componentOptions) { if (componentOptions) {
// check pattern // check pattern
var name = getComponentName(componentOptions); var name = getComponentName(componentOptions);
if (!name || ( var ref = this;
(this.exclude && matches(this.exclude, name)) || var include = ref.include;
(this.include && !matches(this.include, name)) var exclude = ref.exclude;
)) { if (
// not included
(include && (!name || !matches(include, name))) ||
// excluded
(exclude && name && matches(exclude, name))
) {
return vnode return vnode
} }
var ref = this; var ref$1 = this;
var cache = ref.cache; var cache = ref$1.cache;
var keys = ref.keys; var keys = ref$1.keys;
var key = vnode.key == null var key = vnode.key == null
// same constructor may get registered as different local components // same constructor may get registered as different local components
// so cid alone is not enough (#3269) // so cid alone is not enough (#3269)
@ -4966,7 +4971,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
} }
}); });
Vue$3.version = '2.5.6'; Vue$3.version = '2.5.7';
/* */ /* */
@ -9260,6 +9265,15 @@ function processSlot (el) {
} }
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) {
warn$2(
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
"(v-for takes higher priority). Use a wrapper <template> for the " +
"scoped slot to make it clearer.",
true
);
}
el.slotScope = slotScope; el.slotScope = slotScope;
} }
var slotTarget = getBindingAttr(el, 'slot'); var slotTarget = getBindingAttr(el, 'slot');
@ -10300,9 +10314,6 @@ var unaryOperatorsRE = new RegExp('\\b' + (
'delete,typeof,void' 'delete,typeof,void'
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
// check valid identifier for v-for
var identRE = /[A-Za-z_$][\w$]*/;
// strip strings in expressions // strip strings in expressions
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
@ -10360,9 +10371,18 @@ function checkFor (node, text, errors) {
checkIdentifier(node.iterator2, 'v-for iterator', text, errors); checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
} }
function checkIdentifier (ident, type, text, errors) { function checkIdentifier (
if (typeof ident === 'string' && !identRE.test(ident)) { ident,
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); type,
text,
errors
) {
if (typeof ident === 'string') {
try {
new Function(("var " + ident));
} catch (e) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
} }
} }

52
dist/vue.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.5.6 * Vue.js v2.5.7
* (c) 2014-2017 Evan You * (c) 2014-2017 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1937,7 +1937,7 @@ function traverse (val) {
function _traverse (val, seen) { function _traverse (val, seen) {
var i, keys; var i, keys;
var isA = Array.isArray(val); var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { if ((!isA && !isObject(val)) || Object.isFrozen(val)) {
return return
} }
if (val.__ob__) { if (val.__ob__) {
@ -4859,16 +4859,21 @@ var KeepAlive = {
if (componentOptions) { if (componentOptions) {
// check pattern // check pattern
var name = getComponentName(componentOptions); var name = getComponentName(componentOptions);
if (!name || ( var ref = this;
(this.exclude && matches(this.exclude, name)) || var include = ref.include;
(this.include && !matches(this.include, name)) var exclude = ref.exclude;
)) { if (
// not included
(include && (!name || !matches(include, name))) ||
// excluded
(exclude && name && matches(exclude, name))
) {
return vnode return vnode
} }
var ref = this; var ref$1 = this;
var cache = ref.cache; var cache = ref$1.cache;
var keys = ref.keys; var keys = ref$1.keys;
var key = vnode.key == null var key = vnode.key == null
// same constructor may get registered as different local components // same constructor may get registered as different local components
// so cid alone is not enough (#3269) // so cid alone is not enough (#3269)
@ -4957,7 +4962,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
} }
}); });
Vue$3.version = '2.5.6'; Vue$3.version = '2.5.7';
/* */ /* */
@ -9251,6 +9256,15 @@ function processSlot (el) {
} }
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if ("development" !== 'production' && el.attrsMap['v-for']) {
warn$2(
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
"(v-for takes higher priority). Use a wrapper <template> for the " +
"scoped slot to make it clearer.",
true
);
}
el.slotScope = slotScope; el.slotScope = slotScope;
} }
var slotTarget = getBindingAttr(el, 'slot'); var slotTarget = getBindingAttr(el, 'slot');
@ -10291,9 +10305,6 @@ var unaryOperatorsRE = new RegExp('\\b' + (
'delete,typeof,void' 'delete,typeof,void'
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
// check valid identifier for v-for
var identRE = /[A-Za-z_$][\w$]*/;
// strip strings in expressions // strip strings in expressions
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
@ -10351,9 +10362,18 @@ function checkFor (node, text, errors) {
checkIdentifier(node.iterator2, 'v-for iterator', text, errors); checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
} }
function checkIdentifier (ident, type, text, errors) { function checkIdentifier (
if (typeof ident === 'string' && !identRE.test(ident)) { ident,
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); type,
text,
errors
) {
if (typeof ident === 'string') {
try {
new Function(("var " + ident));
} catch (e) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
} }
} }

4
dist/vue.min.js

File diff suppressed because one or more lines are too long

25
dist/vue.runtime.common.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.5.6 * Vue.js v2.5.7
* (c) 2014-2017 Evan You * (c) 2014-2017 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1906,7 +1906,7 @@ function traverse (val) {
function _traverse (val, seen) { function _traverse (val, seen) {
var i, keys; var i, keys;
var isA = Array.isArray(val); var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { if ((!isA && !isObject(val)) || Object.isFrozen(val)) {
return return
} }
if (val.__ob__) { if (val.__ob__) {
@ -4866,16 +4866,21 @@ var KeepAlive = {
if (componentOptions) { if (componentOptions) {
// check pattern // check pattern
var name = getComponentName(componentOptions); var name = getComponentName(componentOptions);
if (!name || ( var ref = this;
(this.exclude && matches(this.exclude, name)) || var include = ref.include;
(this.include && !matches(this.include, name)) var exclude = ref.exclude;
)) { if (
// not included
(include && (!name || !matches(include, name))) ||
// excluded
(exclude && name && matches(exclude, name))
) {
return vnode return vnode
} }
var ref = this; var ref$1 = this;
var cache = ref.cache; var cache = ref$1.cache;
var keys = ref.keys; var keys = ref$1.keys;
var key = vnode.key == null var key = vnode.key == null
// same constructor may get registered as different local components // same constructor may get registered as different local components
// so cid alone is not enough (#3269) // so cid alone is not enough (#3269)
@ -4964,7 +4969,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
} }
}); });
Vue$3.version = '2.5.6'; Vue$3.version = '2.5.7';
/* */ /* */

25
dist/vue.runtime.esm.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.5.6 * Vue.js v2.5.7
* (c) 2014-2017 Evan You * (c) 2014-2017 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1904,7 +1904,7 @@ function traverse (val) {
function _traverse (val, seen) { function _traverse (val, seen) {
var i, keys; var i, keys;
var isA = Array.isArray(val); var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { if ((!isA && !isObject(val)) || Object.isFrozen(val)) {
return return
} }
if (val.__ob__) { if (val.__ob__) {
@ -4864,16 +4864,21 @@ var KeepAlive = {
if (componentOptions) { if (componentOptions) {
// check pattern // check pattern
var name = getComponentName(componentOptions); var name = getComponentName(componentOptions);
if (!name || ( var ref = this;
(this.exclude && matches(this.exclude, name)) || var include = ref.include;
(this.include && !matches(this.include, name)) var exclude = ref.exclude;
)) { if (
// not included
(include && (!name || !matches(include, name))) ||
// excluded
(exclude && name && matches(exclude, name))
) {
return vnode return vnode
} }
var ref = this; var ref$1 = this;
var cache = ref.cache; var cache = ref$1.cache;
var keys = ref.keys; var keys = ref$1.keys;
var key = vnode.key == null var key = vnode.key == null
// same constructor may get registered as different local components // same constructor may get registered as different local components
// so cid alone is not enough (#3269) // so cid alone is not enough (#3269)
@ -4962,7 +4967,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
} }
}); });
Vue$3.version = '2.5.6'; Vue$3.version = '2.5.7';
/* */ /* */

25
dist/vue.runtime.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.5.6 * Vue.js v2.5.7
* (c) 2014-2017 Evan You * (c) 2014-2017 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1910,7 +1910,7 @@ function traverse (val) {
function _traverse (val, seen) { function _traverse (val, seen) {
var i, keys; var i, keys;
var isA = Array.isArray(val); var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { if ((!isA && !isObject(val)) || Object.isFrozen(val)) {
return return
} }
if (val.__ob__) { if (val.__ob__) {
@ -4855,16 +4855,21 @@ var KeepAlive = {
if (componentOptions) { if (componentOptions) {
// check pattern // check pattern
var name = getComponentName(componentOptions); var name = getComponentName(componentOptions);
if (!name || ( var ref = this;
(this.exclude && matches(this.exclude, name)) || var include = ref.include;
(this.include && !matches(this.include, name)) var exclude = ref.exclude;
)) { if (
// not included
(include && (!name || !matches(include, name))) ||
// excluded
(exclude && name && matches(exclude, name))
) {
return vnode return vnode
} }
var ref = this; var ref$1 = this;
var cache = ref.cache; var cache = ref$1.cache;
var keys = ref.keys; var keys = ref$1.keys;
var key = vnode.key == null var key = vnode.key == null
// same constructor may get registered as different local components // same constructor may get registered as different local components
// so cid alone is not enough (#3269) // so cid alone is not enough (#3269)
@ -4953,7 +4958,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
} }
}); });
Vue$3.version = '2.5.6'; Vue$3.version = '2.5.7';
/* */ /* */

4
dist/vue.runtime.min.js

File diff suppressed because one or more lines are too long

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

@ -4027,6 +4027,15 @@ function processSlot (el) {
} }
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if ("development" !== 'production' && el.attrsMap['v-for']) {
warn$1(
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
"(v-for takes higher priority). Use a wrapper <template> for the " +
"scoped slot to make it clearer.",
true
);
}
el.slotScope = slotScope; el.slotScope = slotScope;
} }
var slotTarget = getBindingAttr(el, 'slot'); var slotTarget = getBindingAttr(el, 'slot');
@ -5584,9 +5593,6 @@ var unaryOperatorsRE = new RegExp('\\b' + (
'delete,typeof,void' 'delete,typeof,void'
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
// check valid identifier for v-for
var identRE = /[A-Za-z_$][\w$]*/;
// strip strings in expressions // strip strings in expressions
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
@ -5644,9 +5650,18 @@ function checkFor (node, text, errors) {
checkIdentifier(node.iterator2, 'v-for iterator', text, errors); checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
} }
function checkIdentifier (ident, type, text, errors) { function checkIdentifier (
if (typeof ident === 'string' && !identRE.test(ident)) { ident,
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); type,
text,
errors
) {
if (typeof ident === 'string') {
try {
new Function(("var " + ident));
} catch (e) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
} }
} }
@ -6089,7 +6104,7 @@ function traverse (val) {
function _traverse (val, seen) { function _traverse (val, seen) {
var i, keys; var i, keys;
var isA = Array.isArray(val); var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { if ((!isA && !isObject(val)) || Object.isFrozen(val)) {
return return
} }
if (val.__ob__) { if (val.__ob__) {

31
packages/vue-server-renderer/build.js

@ -3766,6 +3766,15 @@ function processSlot (el) {
} }
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) {
warn$1(
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
"(v-for takes higher priority). Use a wrapper <template> for the " +
"scoped slot to make it clearer.",
true
);
}
el.slotScope = slotScope; el.slotScope = slotScope;
} }
var slotTarget = getBindingAttr(el, 'slot'); var slotTarget = getBindingAttr(el, 'slot');
@ -5323,9 +5332,6 @@ var unaryOperatorsRE = new RegExp('\\b' + (
'delete,typeof,void' 'delete,typeof,void'
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
// check valid identifier for v-for
var identRE = /[A-Za-z_$][\w$]*/;
// strip strings in expressions // strip strings in expressions
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
@ -5383,9 +5389,18 @@ function checkFor (node, text, errors) {
checkIdentifier(node.iterator2, 'v-for iterator', text, errors); checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
} }
function checkIdentifier (ident, type, text, errors) { function checkIdentifier (
if (typeof ident === 'string' && !identRE.test(ident)) { ident,
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); type,
text,
errors
) {
if (typeof ident === 'string') {
try {
new Function(("var " + ident));
} catch (e) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
} }
} }
@ -5828,7 +5843,7 @@ function traverse (val) {
function _traverse (val, seen) { function _traverse (val, seen) {
var i, keys; var i, keys;
var isA = Array.isArray(val); var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) { if ((!isA && !isObject(val)) || Object.isFrozen(val)) {
return return
} }
if (val.__ob__) { if (val.__ob__) {
@ -8466,7 +8481,7 @@ function compileModule (files, basedir, runInNewContext) {
: script.runInNewContext(sandbox); : script.runInNewContext(sandbox);
var m = { exports: {}}; var m = { exports: {}};
var r = function (file) { var r = function (file) {
file = path$2.join('.', file); file = path$2.posix.join('.', file);
if (files[file]) { if (files[file]) {
return evaluateModule(file, sandbox, evaluatedFiles) return evaluateModule(file, sandbox, evaluatedFiles)
} else if (basedir) { } else if (basedir) {

2
packages/vue-server-renderer/package.json

@ -1,6 +1,6 @@
{ {
"name": "vue-server-renderer", "name": "vue-server-renderer",
"version": "2.5.6", "version": "2.5.7",
"description": "server renderer for Vue 2.0", "description": "server renderer for Vue 2.0",
"main": "index.js", "main": "index.js",
"types": "types/index.d.ts", "types": "types/index.d.ts",

27
packages/vue-template-compiler/browser.js

@ -3097,6 +3097,15 @@ function processSlot (el) {
} }
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if ("development" !== 'production' && el.attrsMap['v-for']) {
warn$1(
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
"(v-for takes higher priority). Use a wrapper <template> for the " +
"scoped slot to make it clearer.",
true
);
}
el.slotScope = slotScope; el.slotScope = slotScope;
} }
var slotTarget = getBindingAttr(el, 'slot'); var slotTarget = getBindingAttr(el, 'slot');
@ -4307,9 +4316,6 @@ var unaryOperatorsRE = new RegExp('\\b' + (
'delete,typeof,void' 'delete,typeof,void'
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
// check valid identifier for v-for
var identRE = /[A-Za-z_$][\w$]*/;
// strip strings in expressions // strip strings in expressions
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
@ -4367,9 +4373,18 @@ function checkFor (node, text, errors) {
checkIdentifier(node.iterator2, 'v-for iterator', text, errors); checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
} }
function checkIdentifier (ident, type, text, errors) { function checkIdentifier (
if (typeof ident === 'string' && !identRE.test(ident)) { ident,
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); type,
text,
errors
) {
if (typeof ident === 'string') {
try {
new Function(("var " + ident));
} catch (e) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
} }
} }

27
packages/vue-template-compiler/build.js

@ -2699,6 +2699,15 @@ function processSlot (el) {
} }
el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
} else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) {
warn$1(
"Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
"(v-for takes higher priority). Use a wrapper <template> for the " +
"scoped slot to make it clearer.",
true
);
}
el.slotScope = slotScope; el.slotScope = slotScope;
} }
var slotTarget = getBindingAttr(el, 'slot'); var slotTarget = getBindingAttr(el, 'slot');
@ -3909,9 +3918,6 @@ var unaryOperatorsRE = new RegExp('\\b' + (
'delete,typeof,void' 'delete,typeof,void'
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
// check valid identifier for v-for
var identRE = /[A-Za-z_$][\w$]*/;
// strip strings in expressions // strip strings in expressions
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
@ -3969,9 +3975,18 @@ function checkFor (node, text, errors) {
checkIdentifier(node.iterator2, 'v-for iterator', text, errors); checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
} }
function checkIdentifier (ident, type, text, errors) { function checkIdentifier (
if (typeof ident === 'string' && !identRE.test(ident)) { ident,
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim()))); type,
text,
errors
) {
if (typeof ident === 'string') {
try {
new Function(("var " + ident));
} catch (e) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
} }
} }

2
packages/vue-template-compiler/package.json

@ -1,6 +1,6 @@
{ {
"name": "vue-template-compiler", "name": "vue-template-compiler",
"version": "2.5.6", "version": "2.5.7",
"description": "template compiler for Vue 2.0", "description": "template compiler for Vue 2.0",
"main": "index.js", "main": "index.js",
"unpkg": "browser.js", "unpkg": "browser.js",

Loading…
Cancel
Save