Browse Source

build: build 2.6.11

dev
Evan You 5 years ago
parent
commit
a98048fa67
  1. 55
      dist/vue.common.dev.js
  2. 4
      dist/vue.common.prod.js
  3. 55
      dist/vue.esm.browser.js
  4. 4
      dist/vue.esm.browser.min.js
  5. 55
      dist/vue.esm.js
  6. 55
      dist/vue.js
  7. 4
      dist/vue.min.js
  8. 26
      dist/vue.runtime.common.dev.js
  9. 4
      dist/vue.runtime.common.prod.js
  10. 26
      dist/vue.runtime.esm.js
  11. 26
      dist/vue.runtime.js
  12. 4
      dist/vue.runtime.min.js
  13. 31
      packages/vue-server-renderer/basic.js
  14. 31
      packages/vue-server-renderer/build.dev.js
  15. 2
      packages/vue-server-renderer/build.prod.js
  16. 2
      packages/vue-server-renderer/package.json
  17. 29
      packages/vue-template-compiler/browser.js
  18. 29
      packages/vue-template-compiler/build.js
  19. 2
      packages/vue-template-compiler/package.json
  20. 1655
      packages/weex-template-compiler/build.js
  21. 5179
      packages/weex-vue-framework/factory.js

55
dist/vue.common.dev.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.6.10 * Vue.js v2.6.11
* (c) 2014-2019 Evan You * (c) 2014-2019 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1965,7 +1965,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
isUsingMicroTask = true; isUsingMicroTask = true;
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate. // Fallback to setImmediate.
// Techinically it leverages the (macro) task queue, // Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout. // but it is still a better choice than setTimeout.
timerFunc = function () { timerFunc = function () {
setImmediate(flushCallbacks); setImmediate(flushCallbacks);
@ -2054,7 +2054,7 @@ var initProxy;
warn( warn(
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals' + 'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data', 'See: https://vuejs.org/v2/api/#data',
target target
); );
@ -2914,7 +2914,7 @@ function bindDynamicKeys (baseObj, values) {
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (key !== '' && key !== null) { } else if (key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
("Invalid value for dynamic directive argument (expected string or null): " + key), ("Invalid value for dynamic directive argument (expected string or null): " + key),
this this
@ -3409,6 +3409,12 @@ function _createElement (
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) { if (config.isReservedTag(tag)) {
// platform built-in elements // platform built-in elements
if (isDef(data) && isDef(data.nativeOn)) {
warn(
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
context
);
}
vnode = new VNode( vnode = new VNode(
config.parsePlatformTagName(tag), data, children, config.parsePlatformTagName(tag), data, children,
undefined, undefined, context undefined, undefined, context
@ -3534,7 +3540,7 @@ function renderMixin (Vue) {
// render self // render self
var vnode; var vnode;
try { try {
// There's no need to maintain a stack becaues all render fns are called // There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called // separately from one another. Nested component's render fns are called
// when parent component is patched. // when parent component is patched.
currentRenderingInstance = vm; currentRenderingInstance = vm;
@ -5433,7 +5439,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext value: FunctionalRenderContext
}); });
Vue.version = '2.6.10'; Vue.version = '2.6.11';
/* */ /* */
@ -6106,7 +6112,7 @@ function createPatchFunction (backend) {
} }
} }
function removeVnodes (parentElm, vnodes, startIdx, endIdx) { function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) { for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx]; var ch = vnodes[startIdx];
if (isDef(ch)) { if (isDef(ch)) {
@ -6217,7 +6223,7 @@ function createPatchFunction (backend) {
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) { } else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); removeVnodes(oldCh, oldStartIdx, oldEndIdx);
} }
} }
@ -6309,7 +6315,7 @@ function createPatchFunction (backend) {
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) { } else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1); removeVnodes(oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) { } else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, ''); nodeOps.setTextContent(elm, '');
} }
@ -6538,7 +6544,7 @@ function createPatchFunction (backend) {
// destroy old node // destroy old node
if (isDef(parentElm)) { if (isDef(parentElm)) {
removeVnodes(parentElm, [oldVnode], 0, 0); removeVnodes([oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) { } else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode); invokeDestroyHook(oldVnode);
} }
@ -9244,7 +9250,7 @@ var startTagOpen = new RegExp(("^<" + qnameCapture));
var startTagClose = /^\s*(\/?)>/; var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
var doctype = /^<!DOCTYPE [^>]+>/i; var doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page // #7298: escape - to avoid being passed as HTML comment when inlined in page
var comment = /^<!\--/; var comment = /^<!\--/;
var conditionalComment = /^<!\[/; var conditionalComment = /^<!\[/;
@ -9529,7 +9535,7 @@ function parseHTML (html, options) {
/* */ /* */
var onRE = /^@|^v-on:/; var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/; var dirRE = /^v-|^@|^:|^#/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g; var stripParensRE = /^\(|\)$/g;
@ -10153,7 +10159,7 @@ function processSlotContent (el) {
if (el.parent && !maybeComponent(el.parent)) { if (el.parent && !maybeComponent(el.parent)) {
warn$2( warn$2(
"<template v-slot> can only appear at the root level inside " + "<template v-slot> can only appear at the root level inside " +
"the receiving the component", "the receiving component",
el el
); );
} }
@ -10716,7 +10722,7 @@ function isDirectChildOfTemplateFor (node) {
/* */ /* */
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/; var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
@ -11485,6 +11491,8 @@ function checkNode (node, warn) {
var range = node.rawAttrsMap[name]; var range = node.rawAttrsMap[name];
if (name === 'v-for') { if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), warn, range); checkFor(node, ("v-for=\"" + value + "\""), warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
} else if (onRE.test(name)) { } else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), warn, range); checkEvent(value, (name + "=\"" + value + "\""), warn, range);
} else { } else {
@ -11504,9 +11512,9 @@ function checkNode (node, warn) {
} }
function checkEvent (exp, text, warn, range) { function checkEvent (exp, text, warn, range) {
var stipped = exp.replace(stripStringRE, ''); var stripped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE); var keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn( warn(
"avoid using JavaScript unary operator as property name: " + "avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
@ -11561,6 +11569,19 @@ function checkExpression (exp, text, warn, range) {
} }
} }
function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
"invalid function parameter expression: " + (e.message) + " in\n\n" +
" " + exp + "\n\n" +
" Raw expression: " + (text.trim()) + "\n",
range
);
}
}
/* */ /* */
var range = 2; var range = 2;

4
dist/vue.common.prod.js

File diff suppressed because one or more lines are too long

55
dist/vue.esm.browser.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.6.10 * Vue.js v2.6.11
* (c) 2014-2019 Evan You * (c) 2014-2019 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1996,7 +1996,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
isUsingMicroTask = true; isUsingMicroTask = true;
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate. // Fallback to setImmediate.
// Techinically it leverages the (macro) task queue, // Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout. // but it is still a better choice than setTimeout.
timerFunc = () => { timerFunc = () => {
setImmediate(flushCallbacks); setImmediate(flushCallbacks);
@ -2085,7 +2085,7 @@ let initProxy;
warn( warn(
`Property "${key}" must be accessed with "$data.${key}" because ` + `Property "${key}" must be accessed with "$data.${key}" because ` +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals' + 'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data', 'See: https://vuejs.org/v2/api/#data',
target target
); );
@ -2940,7 +2940,7 @@ function bindDynamicKeys (baseObj, values) {
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (key !== '' && key !== null) { } else if (key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
`Invalid value for dynamic directive argument (expected string or null): ${key}`, `Invalid value for dynamic directive argument (expected string or null): ${key}`,
this this
@ -3432,6 +3432,12 @@ function _createElement (
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) { if (config.isReservedTag(tag)) {
// platform built-in elements // platform built-in elements
if (isDef(data) && isDef(data.nativeOn)) {
warn(
`The .native modifier for v-on is only valid on components but it was used on <${tag}>.`,
context
);
}
vnode = new VNode( vnode = new VNode(
config.parsePlatformTagName(tag), data, children, config.parsePlatformTagName(tag), data, children,
undefined, undefined, context undefined, undefined, context
@ -3555,7 +3561,7 @@ function renderMixin (Vue) {
// render self // render self
let vnode; let vnode;
try { try {
// There's no need to maintain a stack becaues all render fns are called // There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called // separately from one another. Nested component's render fns are called
// when parent component is patched. // when parent component is patched.
currentRenderingInstance = vm; currentRenderingInstance = vm;
@ -5464,7 +5470,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext value: FunctionalRenderContext
}); });
Vue.version = '2.6.10'; Vue.version = '2.6.11';
/* */ /* */
@ -6136,7 +6142,7 @@ function createPatchFunction (backend) {
} }
} }
function removeVnodes (parentElm, vnodes, startIdx, endIdx) { function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) { for (; startIdx <= endIdx; ++startIdx) {
const ch = vnodes[startIdx]; const ch = vnodes[startIdx];
if (isDef(ch)) { if (isDef(ch)) {
@ -6247,7 +6253,7 @@ function createPatchFunction (backend) {
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) { } else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); removeVnodes(oldCh, oldStartIdx, oldEndIdx);
} }
} }
@ -6339,7 +6345,7 @@ function createPatchFunction (backend) {
if (isDef(oldVnode.text)) nodeOps.setTextContent(elm, ''); if (isDef(oldVnode.text)) nodeOps.setTextContent(elm, '');
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) { } else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1); removeVnodes(oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) { } else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, ''); nodeOps.setTextContent(elm, '');
} }
@ -6566,7 +6572,7 @@ function createPatchFunction (backend) {
// destroy old node // destroy old node
if (isDef(parentElm)) { if (isDef(parentElm)) {
removeVnodes(parentElm, [oldVnode], 0, 0); removeVnodes([oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) { } else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode); invokeDestroyHook(oldVnode);
} }
@ -9261,7 +9267,7 @@ const startTagOpen = new RegExp(`^<${qnameCapture}`);
const startTagClose = /^\s*(\/?)>/; const startTagClose = /^\s*(\/?)>/;
const endTag = new RegExp(`^<\\/${qnameCapture}[^>]*>`); const endTag = new RegExp(`^<\\/${qnameCapture}[^>]*>`);
const doctype = /^<!DOCTYPE [^>]+>/i; const doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page // #7298: escape - to avoid being passed as HTML comment when inlined in page
const comment = /^<!\--/; const comment = /^<!\--/;
const conditionalComment = /^<!\[/; const conditionalComment = /^<!\[/;
@ -9546,7 +9552,7 @@ function parseHTML (html, options) {
/* */ /* */
const onRE = /^@|^v-on:/; const onRE = /^@|^v-on:/;
const dirRE = /^v-|^@|^:/; const dirRE = /^v-|^@|^:|^#/;
const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
const stripParensRE = /^\(|\)$/g; const stripParensRE = /^\(|\)$/g;
@ -10170,7 +10176,7 @@ function processSlotContent (el) {
if (el.parent && !maybeComponent(el.parent)) { if (el.parent && !maybeComponent(el.parent)) {
warn$2( warn$2(
`<template v-slot> can only appear at the root level inside ` + `<template v-slot> can only appear at the root level inside ` +
`the receiving the component`, `the receiving component`,
el el
); );
} }
@ -10729,7 +10735,7 @@ function isDirectChildOfTemplateFor (node) {
/* */ /* */
const fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; const fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
const fnInvokeRE = /\([^)]*?\);*$/; const fnInvokeRE = /\([^)]*?\);*$/;
const simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; const simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
@ -11554,6 +11560,8 @@ function checkNode (node, warn) {
const range = node.rawAttrsMap[name]; const range = node.rawAttrsMap[name];
if (name === 'v-for') { if (name === 'v-for') {
checkFor(node, `v-for="${value}"`, warn, range); checkFor(node, `v-for="${value}"`, warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, `${name}="${value}"`, warn, range);
} else if (onRE.test(name)) { } else if (onRE.test(name)) {
checkEvent(value, `${name}="${value}"`, warn, range); checkEvent(value, `${name}="${value}"`, warn, range);
} else { } else {
@ -11573,9 +11581,9 @@ function checkNode (node, warn) {
} }
function checkEvent (exp, text, warn, range) { function checkEvent (exp, text, warn, range) {
const stipped = exp.replace(stripStringRE, ''); const stripped = exp.replace(stripStringRE, '');
const keywordMatch = stipped.match(unaryOperatorsRE); const keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn( warn(
`avoid using JavaScript unary operator as property name: ` + `avoid using JavaScript unary operator as property name: ` +
`"${keywordMatch[0]}" in expression ${text.trim()}`, `"${keywordMatch[0]}" in expression ${text.trim()}`,
@ -11630,6 +11638,19 @@ function checkExpression (exp, text, warn, range) {
} }
} }
function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
`invalid function parameter expression: ${e.message} in\n\n` +
` ${exp}\n\n` +
` Raw expression: ${text.trim()}\n`,
range
);
}
}
/* */ /* */
const range = 2; const range = 2;

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

File diff suppressed because one or more lines are too long

55
dist/vue.esm.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.6.10 * Vue.js v2.6.11
* (c) 2014-2019 Evan You * (c) 2014-2019 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1969,7 +1969,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
isUsingMicroTask = true; isUsingMicroTask = true;
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate. // Fallback to setImmediate.
// Techinically it leverages the (macro) task queue, // Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout. // but it is still a better choice than setTimeout.
timerFunc = function () { timerFunc = function () {
setImmediate(flushCallbacks); setImmediate(flushCallbacks);
@ -2058,7 +2058,7 @@ if (process.env.NODE_ENV !== 'production') {
warn( warn(
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals' + 'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data', 'See: https://vuejs.org/v2/api/#data',
target target
); );
@ -2920,7 +2920,7 @@ function bindDynamicKeys (baseObj, values) {
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) { } else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
("Invalid value for dynamic directive argument (expected string or null): " + key), ("Invalid value for dynamic directive argument (expected string or null): " + key),
this this
@ -3416,6 +3416,12 @@ function _createElement (
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) { if (config.isReservedTag(tag)) {
// platform built-in elements // platform built-in elements
if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.nativeOn)) {
warn(
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
context
);
}
vnode = new VNode( vnode = new VNode(
config.parsePlatformTagName(tag), data, children, config.parsePlatformTagName(tag), data, children,
undefined, undefined, context undefined, undefined, context
@ -3544,7 +3550,7 @@ function renderMixin (Vue) {
// render self // render self
var vnode; var vnode;
try { try {
// There's no need to maintain a stack becaues all render fns are called // There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called // separately from one another. Nested component's render fns are called
// when parent component is patched. // when parent component is patched.
currentRenderingInstance = vm; currentRenderingInstance = vm;
@ -5453,7 +5459,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext value: FunctionalRenderContext
}); });
Vue.version = '2.6.10'; Vue.version = '2.6.11';
/* */ /* */
@ -6126,7 +6132,7 @@ function createPatchFunction (backend) {
} }
} }
function removeVnodes (parentElm, vnodes, startIdx, endIdx) { function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) { for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx]; var ch = vnodes[startIdx];
if (isDef(ch)) { if (isDef(ch)) {
@ -6237,7 +6243,7 @@ function createPatchFunction (backend) {
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) { } else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); removeVnodes(oldCh, oldStartIdx, oldEndIdx);
} }
} }
@ -6329,7 +6335,7 @@ function createPatchFunction (backend) {
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) { } else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1); removeVnodes(oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) { } else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, ''); nodeOps.setTextContent(elm, '');
} }
@ -6560,7 +6566,7 @@ function createPatchFunction (backend) {
// destroy old node // destroy old node
if (isDef(parentElm)) { if (isDef(parentElm)) {
removeVnodes(parentElm, [oldVnode], 0, 0); removeVnodes([oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) { } else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode); invokeDestroyHook(oldVnode);
} }
@ -9272,7 +9278,7 @@ var startTagOpen = new RegExp(("^<" + qnameCapture));
var startTagClose = /^\s*(\/?)>/; var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
var doctype = /^<!DOCTYPE [^>]+>/i; var doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page // #7298: escape - to avoid being passed as HTML comment when inlined in page
var comment = /^<!\--/; var comment = /^<!\--/;
var conditionalComment = /^<!\[/; var conditionalComment = /^<!\[/;
@ -9558,7 +9564,7 @@ function parseHTML (html, options) {
/* */ /* */
var onRE = /^@|^v-on:/; var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/; var dirRE = /^v-|^@|^:|^#/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g; var stripParensRE = /^\(|\)$/g;
@ -10182,7 +10188,7 @@ function processSlotContent (el) {
if (el.parent && !maybeComponent(el.parent)) { if (el.parent && !maybeComponent(el.parent)) {
warn$2( warn$2(
"<template v-slot> can only appear at the root level inside " + "<template v-slot> can only appear at the root level inside " +
"the receiving the component", "the receiving component",
el el
); );
} }
@ -10747,7 +10753,7 @@ function isDirectChildOfTemplateFor (node) {
/* */ /* */
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/; var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
@ -11519,6 +11525,8 @@ function checkNode (node, warn) {
var range = node.rawAttrsMap[name]; var range = node.rawAttrsMap[name];
if (name === 'v-for') { if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), warn, range); checkFor(node, ("v-for=\"" + value + "\""), warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
} else if (onRE.test(name)) { } else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), warn, range); checkEvent(value, (name + "=\"" + value + "\""), warn, range);
} else { } else {
@ -11538,9 +11546,9 @@ function checkNode (node, warn) {
} }
function checkEvent (exp, text, warn, range) { function checkEvent (exp, text, warn, range) {
var stipped = exp.replace(stripStringRE, ''); var stripped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE); var keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn( warn(
"avoid using JavaScript unary operator as property name: " + "avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
@ -11595,6 +11603,19 @@ function checkExpression (exp, text, warn, range) {
} }
} }
function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
"invalid function parameter expression: " + (e.message) + " in\n\n" +
" " + exp + "\n\n" +
" Raw expression: " + (text.trim()) + "\n",
range
);
}
}
/* */ /* */
var range = 2; var range = 2;

55
dist/vue.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.6.10 * Vue.js v2.6.11
* (c) 2014-2019 Evan You * (c) 2014-2019 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1969,7 +1969,7 @@
isUsingMicroTask = true; isUsingMicroTask = true;
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate. // Fallback to setImmediate.
// Techinically it leverages the (macro) task queue, // Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout. // but it is still a better choice than setTimeout.
timerFunc = function () { timerFunc = function () {
setImmediate(flushCallbacks); setImmediate(flushCallbacks);
@ -2058,7 +2058,7 @@
warn( warn(
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals' + 'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data', 'See: https://vuejs.org/v2/api/#data',
target target
); );
@ -2918,7 +2918,7 @@
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (key !== '' && key !== null) { } else if (key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
("Invalid value for dynamic directive argument (expected string or null): " + key), ("Invalid value for dynamic directive argument (expected string or null): " + key),
this this
@ -3413,6 +3413,12 @@
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) { if (config.isReservedTag(tag)) {
// platform built-in elements // platform built-in elements
if (isDef(data) && isDef(data.nativeOn)) {
warn(
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
context
);
}
vnode = new VNode( vnode = new VNode(
config.parsePlatformTagName(tag), data, children, config.parsePlatformTagName(tag), data, children,
undefined, undefined, context undefined, undefined, context
@ -3538,7 +3544,7 @@
// render self // render self
var vnode; var vnode;
try { try {
// There's no need to maintain a stack becaues all render fns are called // There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called // separately from one another. Nested component's render fns are called
// when parent component is patched. // when parent component is patched.
currentRenderingInstance = vm; currentRenderingInstance = vm;
@ -5437,7 +5443,7 @@
value: FunctionalRenderContext value: FunctionalRenderContext
}); });
Vue.version = '2.6.10'; Vue.version = '2.6.11';
/* */ /* */
@ -6110,7 +6116,7 @@
} }
} }
function removeVnodes (parentElm, vnodes, startIdx, endIdx) { function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) { for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx]; var ch = vnodes[startIdx];
if (isDef(ch)) { if (isDef(ch)) {
@ -6221,7 +6227,7 @@
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) { } else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); removeVnodes(oldCh, oldStartIdx, oldEndIdx);
} }
} }
@ -6313,7 +6319,7 @@
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) { } else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1); removeVnodes(oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) { } else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, ''); nodeOps.setTextContent(elm, '');
} }
@ -6542,7 +6548,7 @@
// destroy old node // destroy old node
if (isDef(parentElm)) { if (isDef(parentElm)) {
removeVnodes(parentElm, [oldVnode], 0, 0); removeVnodes([oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) { } else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode); invokeDestroyHook(oldVnode);
} }
@ -9248,7 +9254,7 @@
var startTagClose = /^\s*(\/?)>/; var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
var doctype = /^<!DOCTYPE [^>]+>/i; var doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page // #7298: escape - to avoid being passed as HTML comment when inlined in page
var comment = /^<!\--/; var comment = /^<!\--/;
var conditionalComment = /^<!\[/; var conditionalComment = /^<!\[/;
@ -9533,7 +9539,7 @@
/* */ /* */
var onRE = /^@|^v-on:/; var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/; var dirRE = /^v-|^@|^:|^#/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g; var stripParensRE = /^\(|\)$/g;
@ -10157,7 +10163,7 @@
if (el.parent && !maybeComponent(el.parent)) { if (el.parent && !maybeComponent(el.parent)) {
warn$2( warn$2(
"<template v-slot> can only appear at the root level inside " + "<template v-slot> can only appear at the root level inside " +
"the receiving the component", "the receiving component",
el el
); );
} }
@ -10720,7 +10726,7 @@
/* */ /* */
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/; var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
@ -11489,6 +11495,8 @@
var range = node.rawAttrsMap[name]; var range = node.rawAttrsMap[name];
if (name === 'v-for') { if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), warn, range); checkFor(node, ("v-for=\"" + value + "\""), warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
} else if (onRE.test(name)) { } else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), warn, range); checkEvent(value, (name + "=\"" + value + "\""), warn, range);
} else { } else {
@ -11508,9 +11516,9 @@
} }
function checkEvent (exp, text, warn, range) { function checkEvent (exp, text, warn, range) {
var stipped = exp.replace(stripStringRE, ''); var stripped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE); var keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn( warn(
"avoid using JavaScript unary operator as property name: " + "avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
@ -11565,6 +11573,19 @@
} }
} }
function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
"invalid function parameter expression: " + (e.message) + " in\n\n" +
" " + exp + "\n\n" +
" Raw expression: " + (text.trim()) + "\n",
range
);
}
}
/* */ /* */
var range = 2; var range = 2;

4
dist/vue.min.js

File diff suppressed because one or more lines are too long

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

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.6.10 * Vue.js v2.6.11
* (c) 2014-2019 Evan You * (c) 2014-2019 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1956,7 +1956,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
isUsingMicroTask = true; isUsingMicroTask = true;
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate. // Fallback to setImmediate.
// Techinically it leverages the (macro) task queue, // Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout. // but it is still a better choice than setTimeout.
timerFunc = function () { timerFunc = function () {
setImmediate(flushCallbacks); setImmediate(flushCallbacks);
@ -2022,7 +2022,7 @@ var initProxy;
warn( warn(
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals' + 'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data', 'See: https://vuejs.org/v2/api/#data',
target target
); );
@ -2905,7 +2905,7 @@ function bindDynamicKeys (baseObj, values) {
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (key !== '' && key !== null) { } else if (key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
("Invalid value for dynamic directive argument (expected string or null): " + key), ("Invalid value for dynamic directive argument (expected string or null): " + key),
this this
@ -3400,6 +3400,12 @@ function _createElement (
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) { if (config.isReservedTag(tag)) {
// platform built-in elements // platform built-in elements
if (isDef(data) && isDef(data.nativeOn)) {
warn(
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
context
);
}
vnode = new VNode( vnode = new VNode(
config.parsePlatformTagName(tag), data, children, config.parsePlatformTagName(tag), data, children,
undefined, undefined, context undefined, undefined, context
@ -3525,7 +3531,7 @@ function renderMixin (Vue) {
// render self // render self
var vnode; var vnode;
try { try {
// There's no need to maintain a stack becaues all render fns are called // There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called // separately from one another. Nested component's render fns are called
// when parent component is patched. // when parent component is patched.
currentRenderingInstance = vm; currentRenderingInstance = vm;
@ -5424,7 +5430,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext value: FunctionalRenderContext
}); });
Vue.version = '2.6.10'; Vue.version = '2.6.11';
/* */ /* */
@ -6095,7 +6101,7 @@ function createPatchFunction (backend) {
} }
} }
function removeVnodes (parentElm, vnodes, startIdx, endIdx) { function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) { for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx]; var ch = vnodes[startIdx];
if (isDef(ch)) { if (isDef(ch)) {
@ -6206,7 +6212,7 @@ function createPatchFunction (backend) {
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) { } else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); removeVnodes(oldCh, oldStartIdx, oldEndIdx);
} }
} }
@ -6298,7 +6304,7 @@ function createPatchFunction (backend) {
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) { } else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1); removeVnodes(oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) { } else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, ''); nodeOps.setTextContent(elm, '');
} }
@ -6527,7 +6533,7 @@ function createPatchFunction (backend) {
// destroy old node // destroy old node
if (isDef(parentElm)) { if (isDef(parentElm)) {
removeVnodes(parentElm, [oldVnode], 0, 0); removeVnodes([oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) { } else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode); invokeDestroyHook(oldVnode);
} }

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

File diff suppressed because one or more lines are too long

26
dist/vue.runtime.esm.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.6.10 * Vue.js v2.6.11
* (c) 2014-2019 Evan You * (c) 2014-2019 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1960,7 +1960,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
isUsingMicroTask = true; isUsingMicroTask = true;
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate. // Fallback to setImmediate.
// Techinically it leverages the (macro) task queue, // Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout. // but it is still a better choice than setTimeout.
timerFunc = function () { timerFunc = function () {
setImmediate(flushCallbacks); setImmediate(flushCallbacks);
@ -2026,7 +2026,7 @@ if (process.env.NODE_ENV !== 'production') {
warn( warn(
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals' + 'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data', 'See: https://vuejs.org/v2/api/#data',
target target
); );
@ -2911,7 +2911,7 @@ function bindDynamicKeys (baseObj, values) {
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) { } else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
("Invalid value for dynamic directive argument (expected string or null): " + key), ("Invalid value for dynamic directive argument (expected string or null): " + key),
this this
@ -3407,6 +3407,12 @@ function _createElement (
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) { if (config.isReservedTag(tag)) {
// platform built-in elements // platform built-in elements
if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.nativeOn)) {
warn(
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
context
);
}
vnode = new VNode( vnode = new VNode(
config.parsePlatformTagName(tag), data, children, config.parsePlatformTagName(tag), data, children,
undefined, undefined, context undefined, undefined, context
@ -3535,7 +3541,7 @@ function renderMixin (Vue) {
// render self // render self
var vnode; var vnode;
try { try {
// There's no need to maintain a stack becaues all render fns are called // There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called // separately from one another. Nested component's render fns are called
// when parent component is patched. // when parent component is patched.
currentRenderingInstance = vm; currentRenderingInstance = vm;
@ -5444,7 +5450,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext value: FunctionalRenderContext
}); });
Vue.version = '2.6.10'; Vue.version = '2.6.11';
/* */ /* */
@ -6115,7 +6121,7 @@ function createPatchFunction (backend) {
} }
} }
function removeVnodes (parentElm, vnodes, startIdx, endIdx) { function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) { for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx]; var ch = vnodes[startIdx];
if (isDef(ch)) { if (isDef(ch)) {
@ -6226,7 +6232,7 @@ function createPatchFunction (backend) {
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) { } else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); removeVnodes(oldCh, oldStartIdx, oldEndIdx);
} }
} }
@ -6318,7 +6324,7 @@ function createPatchFunction (backend) {
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) { } else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1); removeVnodes(oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) { } else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, ''); nodeOps.setTextContent(elm, '');
} }
@ -6549,7 +6555,7 @@ function createPatchFunction (backend) {
// destroy old node // destroy old node
if (isDef(parentElm)) { if (isDef(parentElm)) {
removeVnodes(parentElm, [oldVnode], 0, 0); removeVnodes([oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) { } else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode); invokeDestroyHook(oldVnode);
} }

26
dist/vue.runtime.js

@ -1,5 +1,5 @@
/*! /*!
* Vue.js v2.6.10 * Vue.js v2.6.11
* (c) 2014-2019 Evan You * (c) 2014-2019 Evan You
* Released under the MIT License. * Released under the MIT License.
*/ */
@ -1960,7 +1960,7 @@
isUsingMicroTask = true; isUsingMicroTask = true;
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
// Fallback to setImmediate. // Fallback to setImmediate.
// Techinically it leverages the (macro) task queue, // Technically it leverages the (macro) task queue,
// but it is still a better choice than setTimeout. // but it is still a better choice than setTimeout.
timerFunc = function () { timerFunc = function () {
setImmediate(flushCallbacks); setImmediate(flushCallbacks);
@ -2026,7 +2026,7 @@
warn( warn(
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
'prevent conflicts with Vue internals' + 'prevent conflicts with Vue internals. ' +
'See: https://vuejs.org/v2/api/#data', 'See: https://vuejs.org/v2/api/#data',
target target
); );
@ -2909,7 +2909,7 @@
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (key !== '' && key !== null) { } else if (key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
("Invalid value for dynamic directive argument (expected string or null): " + key), ("Invalid value for dynamic directive argument (expected string or null): " + key),
this this
@ -3404,6 +3404,12 @@
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
if (config.isReservedTag(tag)) { if (config.isReservedTag(tag)) {
// platform built-in elements // platform built-in elements
if (isDef(data) && isDef(data.nativeOn)) {
warn(
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
context
);
}
vnode = new VNode( vnode = new VNode(
config.parsePlatformTagName(tag), data, children, config.parsePlatformTagName(tag), data, children,
undefined, undefined, context undefined, undefined, context
@ -3529,7 +3535,7 @@
// render self // render self
var vnode; var vnode;
try { try {
// There's no need to maintain a stack becaues all render fns are called // There's no need to maintain a stack because all render fns are called
// separately from one another. Nested component's render fns are called // separately from one another. Nested component's render fns are called
// when parent component is patched. // when parent component is patched.
currentRenderingInstance = vm; currentRenderingInstance = vm;
@ -5428,7 +5434,7 @@
value: FunctionalRenderContext value: FunctionalRenderContext
}); });
Vue.version = '2.6.10'; Vue.version = '2.6.11';
/* */ /* */
@ -6099,7 +6105,7 @@
} }
} }
function removeVnodes (parentElm, vnodes, startIdx, endIdx) { function removeVnodes (vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) { for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx]; var ch = vnodes[startIdx];
if (isDef(ch)) { if (isDef(ch)) {
@ -6210,7 +6216,7 @@
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) { } else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); removeVnodes(oldCh, oldStartIdx, oldEndIdx);
} }
} }
@ -6302,7 +6308,7 @@
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) { } else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1); removeVnodes(oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) { } else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, ''); nodeOps.setTextContent(elm, '');
} }
@ -6531,7 +6537,7 @@
// destroy old node // destroy old node
if (isDef(parentElm)) { if (isDef(parentElm)) {
removeVnodes(parentElm, [oldVnode], 0, 0); removeVnodes([oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) { } else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode); invokeDestroyHook(oldVnode);
} }

4
dist/vue.runtime.min.js

File diff suppressed because one or more lines are too long

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

@ -3373,7 +3373,7 @@
var startTagClose = /^\s*(\/?)>/; var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
var doctype = /^<!DOCTYPE [^>]+>/i; var doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page // #7298: escape - to avoid being passed as HTML comment when inlined in page
var comment = /^<!\--/; var comment = /^<!\--/;
var conditionalComment = /^<!\[/; var conditionalComment = /^<!\[/;
@ -3806,7 +3806,7 @@
/* */ /* */
var onRE = /^@|^v-on:/; var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/; var dirRE = /^v-|^@|^:|^#/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g; var stripParensRE = /^\(|\)$/g;
@ -4430,7 +4430,7 @@
if (el.parent && !maybeComponent(el.parent)) { if (el.parent && !maybeComponent(el.parent)) {
warn$1( warn$1(
"<template v-slot> can only appear at the root level inside " + "<template v-slot> can only appear at the root level inside " +
"the receiving the component", "the receiving component",
el el
); );
} }
@ -5032,7 +5032,7 @@
/* */ /* */
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/; var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
@ -6272,6 +6272,8 @@
var range = node.rawAttrsMap[name]; var range = node.rawAttrsMap[name];
if (name === 'v-for') { if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), warn, range); checkFor(node, ("v-for=\"" + value + "\""), warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
} else if (onRE.test(name)) { } else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), warn, range); checkEvent(value, (name + "=\"" + value + "\""), warn, range);
} else { } else {
@ -6291,9 +6293,9 @@
} }
function checkEvent (exp, text, warn, range) { function checkEvent (exp, text, warn, range) {
var stipped = exp.replace(stripStringRE, ''); var stripped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE); var keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn( warn(
"avoid using JavaScript unary operator as property name: " + "avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
@ -6348,6 +6350,19 @@
} }
} }
function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
"invalid function parameter expression: " + (e.message) + " in\n\n" +
" " + exp + "\n\n" +
" Raw expression: " + (text.trim()) + "\n",
range
);
}
}
/* */ /* */
var range = 2; var range = 2;
@ -7473,7 +7488,7 @@
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (key !== '' && key !== null) { } else if (key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
("Invalid value for dynamic directive argument (expected string or null): " + key), ("Invalid value for dynamic directive argument (expected string or null): " + key),
this this

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

@ -3123,7 +3123,7 @@ var startTagOpen = new RegExp(("^<" + qnameCapture));
var startTagClose = /^\s*(\/?)>/; var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
var doctype = /^<!DOCTYPE [^>]+>/i; var doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page // #7298: escape - to avoid being passed as HTML comment when inlined in page
var comment = /^<!\--/; var comment = /^<!\--/;
var conditionalComment = /^<!\[/; var conditionalComment = /^<!\[/;
@ -3556,7 +3556,7 @@ function parseString (chr) {
/* */ /* */
var onRE = /^@|^v-on:/; var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/; var dirRE = /^v-|^@|^:|^#/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g; var stripParensRE = /^\(|\)$/g;
@ -4180,7 +4180,7 @@ function processSlotContent (el) {
if (el.parent && !maybeComponent(el.parent)) { if (el.parent && !maybeComponent(el.parent)) {
warn$1( warn$1(
"<template v-slot> can only appear at the root level inside " + "<template v-slot> can only appear at the root level inside " +
"the receiving the component", "the receiving component",
el el
); );
} }
@ -4782,7 +4782,7 @@ var baseOptions = {
/* */ /* */
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/; var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
@ -6022,6 +6022,8 @@ function checkNode (node, warn) {
var range = node.rawAttrsMap[name]; var range = node.rawAttrsMap[name];
if (name === 'v-for') { if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), warn, range); checkFor(node, ("v-for=\"" + value + "\""), warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
} else if (onRE.test(name)) { } else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), warn, range); checkEvent(value, (name + "=\"" + value + "\""), warn, range);
} else { } else {
@ -6041,9 +6043,9 @@ function checkNode (node, warn) {
} }
function checkEvent (exp, text, warn, range) { function checkEvent (exp, text, warn, range) {
var stipped = exp.replace(stripStringRE, ''); var stripped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE); var keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn( warn(
"avoid using JavaScript unary operator as property name: " + "avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
@ -6098,6 +6100,19 @@ function checkExpression (exp, text, warn, range) {
} }
} }
function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
"invalid function parameter expression: " + (e.message) + " in\n\n" +
" " + exp + "\n\n" +
" Raw expression: " + (text.trim()) + "\n",
range
);
}
}
/* */ /* */
var range = 2; var range = 2;
@ -7223,7 +7238,7 @@ function bindDynamicKeys (baseObj, values) {
if (typeof key === 'string' && key) { if (typeof key === 'string' && key) {
baseObj[values[i]] = values[i + 1]; baseObj[values[i]] = values[i + 1];
} else if (key !== '' && key !== null) { } else if (key !== '' && key !== null) {
// null is a speical value for explicitly removing a binding // null is a special value for explicitly removing a binding
warn( warn(
("Invalid value for dynamic directive argument (expected string or null): " + key), ("Invalid value for dynamic directive argument (expected string or null): " + key),
this this

2
packages/vue-server-renderer/build.prod.js

File diff suppressed because one or more lines are too long

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

@ -1,6 +1,6 @@
{ {
"name": "vue-server-renderer", "name": "vue-server-renderer",
"version": "2.6.10", "version": "2.6.11",
"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",

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

@ -310,7 +310,7 @@
var startTagClose = /^\s*(\/?)>/; var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
var doctype = /^<!DOCTYPE [^>]+>/i; var doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page // #7298: escape - to avoid being passed as HTML comment when inlined in page
var comment = /^<!\--/; var comment = /^<!\--/;
var conditionalComment = /^<!\[/; var conditionalComment = /^<!\[/;
@ -2729,7 +2729,7 @@
/* */ /* */
var onRE = /^@|^v-on:/; var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/; var dirRE = /^v-|^@|^:|^#/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g; var stripParensRE = /^\(|\)$/g;
@ -3353,7 +3353,7 @@
if (el.parent && !maybeComponent(el.parent)) { if (el.parent && !maybeComponent(el.parent)) {
warn$1( warn$1(
"<template v-slot> can only appear at the root level inside " + "<template v-slot> can only appear at the root level inside " +
"the receiving the component", "the receiving component",
el el
); );
} }
@ -4082,7 +4082,7 @@
/* */ /* */
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/; var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
@ -4851,6 +4851,8 @@
var range = node.rawAttrsMap[name]; var range = node.rawAttrsMap[name];
if (name === 'v-for') { if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), warn, range); checkFor(node, ("v-for=\"" + value + "\""), warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
} else if (onRE.test(name)) { } else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), warn, range); checkEvent(value, (name + "=\"" + value + "\""), warn, range);
} else { } else {
@ -4870,9 +4872,9 @@
} }
function checkEvent (exp, text, warn, range) { function checkEvent (exp, text, warn, range) {
var stipped = exp.replace(stripStringRE, ''); var stripped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE); var keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn( warn(
"avoid using JavaScript unary operator as property name: " + "avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
@ -4927,6 +4929,19 @@
} }
} }
function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
"invalid function parameter expression: " + (e.message) + " in\n\n" +
" " + exp + "\n\n" +
" Raw expression: " + (text.trim()) + "\n",
range
);
}
}
/* */ /* */
var range = 2; var range = 2;

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

@ -267,7 +267,7 @@ var startTagOpen = new RegExp(("^<" + qnameCapture));
var startTagClose = /^\s*(\/?)>/; var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
var doctype = /^<!DOCTYPE [^>]+>/i; var doctype = /^<!DOCTYPE [^>]+>/i;
// #7298: escape - to avoid being pased as HTML comment when inlined in page // #7298: escape - to avoid being passed as HTML comment when inlined in page
var comment = /^<!\--/; var comment = /^<!\--/;
var conditionalComment = /^<!\[/; var conditionalComment = /^<!\[/;
@ -2349,7 +2349,7 @@ function parseString (chr) {
/* */ /* */
var onRE = /^@|^v-on:/; var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/; var dirRE = /^v-|^@|^:|^#/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g; var stripParensRE = /^\(|\)$/g;
@ -2973,7 +2973,7 @@ function processSlotContent (el) {
if (el.parent && !maybeComponent(el.parent)) { if (el.parent && !maybeComponent(el.parent)) {
warn$1( warn$1(
"<template v-slot> can only appear at the root level inside " + "<template v-slot> can only appear at the root level inside " +
"the receiving the component", "the receiving component",
el el
); );
} }
@ -3712,7 +3712,7 @@ function isDirectChildOfTemplateFor (node) {
/* */ /* */
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/; var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/; var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
@ -4484,6 +4484,8 @@ function checkNode (node, warn) {
var range = node.rawAttrsMap[name]; var range = node.rawAttrsMap[name];
if (name === 'v-for') { if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), warn, range); checkFor(node, ("v-for=\"" + value + "\""), warn, range);
} else if (name === 'v-slot' || name[0] === '#') {
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
} else if (onRE.test(name)) { } else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), warn, range); checkEvent(value, (name + "=\"" + value + "\""), warn, range);
} else { } else {
@ -4503,9 +4505,9 @@ function checkNode (node, warn) {
} }
function checkEvent (exp, text, warn, range) { function checkEvent (exp, text, warn, range) {
var stipped = exp.replace(stripStringRE, ''); var stripped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE); var keywordMatch = stripped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') { if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
warn( warn(
"avoid using JavaScript unary operator as property name: " + "avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
@ -4560,6 +4562,19 @@ function checkExpression (exp, text, warn, range) {
} }
} }
function checkFunctionParameterExpression (exp, text, warn, range) {
try {
new Function(exp, '');
} catch (e) {
warn(
"invalid function parameter expression: " + (e.message) + " in\n\n" +
" " + exp + "\n\n" +
" Raw expression: " + (text.trim()) + "\n",
range
);
}
}
/* */ /* */
var range = 2; var range = 2;

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

@ -1,6 +1,6 @@
{ {
"name": "vue-template-compiler", "name": "vue-template-compiler",
"version": "2.6.10", "version": "2.6.11",
"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",

1655
packages/weex-template-compiler/build.js

File diff suppressed because it is too large

5179
packages/weex-vue-framework/factory.js

File diff suppressed because it is too large
Loading…
Cancel
Save