Skip to content

Commit ebe658e

Browse files
committed
2.0.5
1 parent c9bac2a commit ebe658e

File tree

4 files changed

+52
-39
lines changed

4 files changed

+52
-39
lines changed

themes/vue/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
site_description: "Vue.js - Intuitive, Fast and Composable MVVM for building interactive interfaces."
22
google_analytics: UA-46852172-1
33
root_domain: cn.vuejs.org
4-
vue_version: 2.0.4
4+
vue_version: 2.0.5

themes/vue/source/js/vue.js

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v2.0.4
2+
* Vue.js v2.0.5
33
* (c) 2014-2016 Evan You
44
* Released under the MIT License.
55
*/
@@ -1769,6 +1769,7 @@ function lifecycleMixin (Vue) {
17691769
{
17701770
observerState.isSettingProps = false;
17711771
}
1772+
vm.$options.propsData = propsData;
17721773
}
17731774
// update listeners
17741775
if (listeners) {
@@ -2192,8 +2193,9 @@ function _createElement (
21922193
// unknown or unlisted namespaced elements
21932194
// check at runtime because it may get assigned a namespace when its
21942195
// parent normalizes children
2196+
var childNs = tag === 'foreignObject' ? 'xhtml' : ns;
21952197
return new VNode(
2196-
tag, data, normalizeChildren(children, ns),
2198+
tag, data, normalizeChildren(children, childNs),
21972199
undefined, undefined, ns, context
21982200
)
21992201
}
@@ -2259,7 +2261,7 @@ function renderMixin (Vue) {
22592261
if (config._isServer) {
22602262
throw e
22612263
} else {
2262-
setTimeout(function () { throw e }, 0);
2264+
console.error(e);
22632265
}
22642266
}
22652267
// return previous vnode to prevent render error causing blank component
@@ -2847,25 +2849,16 @@ var defaultStrat = function (parentVal, childVal) {
28472849
};
28482850

28492851
/**
2850-
* Make sure component options get converted to actual
2851-
* constructors.
2852+
* Validate component names
28522853
*/
2853-
function normalizeComponents (options) {
2854-
if (options.components) {
2855-
var components = options.components;
2856-
var normalized = options.components = {};
2857-
var def;
2858-
for (var key in components) {
2859-
var lower = key.toLowerCase();
2860-
if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
2861-
"development" !== 'production' && warn(
2862-
'Do not use built-in or reserved HTML elements as component ' +
2863-
'id: ' + key
2864-
);
2865-
continue
2866-
}
2867-
def = components[key];
2868-
normalized[key] = isPlainObject(def) ? Vue$2.extend(def) : def;
2854+
function checkComponents (options) {
2855+
for (var key in options.components) {
2856+
var lower = key.toLowerCase();
2857+
if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
2858+
warn(
2859+
'Do not use built-in or reserved HTML elements as component ' +
2860+
'id: ' + key
2861+
);
28692862
}
28702863
}
28712864
}
@@ -2926,7 +2919,9 @@ function mergeOptions (
29262919
child,
29272920
vm
29282921
) {
2929-
normalizeComponents(child);
2922+
{
2923+
checkComponents(child);
2924+
}
29302925
normalizeProps(child);
29312926
normalizeDirectives(child);
29322927
var extendsFrom = child.extends;
@@ -3029,7 +3024,7 @@ function validateProp (
30293024
/**
30303025
* Get the default value of a prop.
30313026
*/
3032-
function getPropDefaultValue (vm, prop, name) {
3027+
function getPropDefaultValue (vm, prop, key) {
30333028
// no default, return undefined
30343029
if (!hasOwn(prop, 'default')) {
30353030
return undefined
@@ -3038,12 +3033,19 @@ function getPropDefaultValue (vm, prop, name) {
30383033
// warn against non-factory defaults for Object & Array
30393034
if (isObject(def)) {
30403035
"development" !== 'production' && warn(
3041-
'Invalid default value for prop "' + name + '": ' +
3036+
'Invalid default value for prop "' + key + '": ' +
30423037
'Props with type Object/Array must use a factory function ' +
30433038
'to return the default value.',
30443039
vm
30453040
);
30463041
}
3042+
// the raw prop value was also undefined from previous render,
3043+
// return previous default value to avoid unnecessary watcher trigger
3044+
if (vm && vm.$options.propsData &&
3045+
vm.$options.propsData[key] === undefined &&
3046+
vm[key] !== undefined) {
3047+
return vm[key]
3048+
}
30473049
// call factory function for non-Function types
30483050
return typeof def === 'function' && prop.type !== Function
30493051
? def.call(vm)
@@ -3408,7 +3410,7 @@ Object.defineProperty(Vue$2.prototype, '$isServer', {
34083410
get: function () { return config._isServer; }
34093411
});
34103412

3411-
Vue$2.version = '2.0.4';
3413+
Vue$2.version = '2.0.5';
34123414

34133415
/* */
34143416

@@ -3534,7 +3536,8 @@ function stringifyClass (value) {
35343536

35353537
var namespaceMap = {
35363538
svg: 'http://www.w3.org/2000/svg',
3537-
math: 'http://www.w3.org/1998/Math/MathML'
3539+
math: 'http://www.w3.org/1998/Math/MathML',
3540+
xhtml: 'http://www.w3.org/1999/xhtm'
35383541
};
35393542

35403543
var isHTMLTag = makeMap(
@@ -5724,6 +5727,8 @@ var startTagOpen = new RegExp('^<' + qnameCapture);
57245727
var startTagClose = /^\s*(\/?)>/;
57255728
var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
57265729
var doctype = /^<!DOCTYPE [^>]+>/i;
5730+
var comment = /^<!--/;
5731+
var conditionalComment = /^<!\[/;
57275732

57285733
var IS_REGEX_CAPTURING_BROKEN = false;
57295734
'x'.replace(/x(.)?/g, function (m, g) {
@@ -5781,7 +5786,7 @@ function parseHTML (html, options) {
57815786
var textEnd = html.indexOf('<');
57825787
if (textEnd === 0) {
57835788
// Comment:
5784-
if (/^<!--/.test(html)) {
5789+
if (comment.test(html)) {
57855790
var commentEnd = html.indexOf('-->');
57865791

57875792
if (commentEnd >= 0) {
@@ -5791,7 +5796,7 @@ function parseHTML (html, options) {
57915796
}
57925797

57935798
// http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
5794-
if (/^<!\[/.test(html)) {
5799+
if (conditionalComment.test(html)) {
57955800
var conditionalEnd = html.indexOf(']>');
57965801

57975802
if (conditionalEnd >= 0) {
@@ -5824,12 +5829,19 @@ function parseHTML (html, options) {
58245829
}
58255830
}
58265831

5827-
var text = void 0, rest$1 = void 0;
5832+
var text = void 0, rest$1 = void 0, next = void 0;
58285833
if (textEnd > 0) {
58295834
rest$1 = html.slice(textEnd);
5830-
while (!startTagOpen.test(rest$1) && !endTag.test(rest$1)) {
5835+
while (
5836+
!endTag.test(rest$1) &&
5837+
!startTagOpen.test(rest$1) &&
5838+
!comment.test(rest$1) &&
5839+
!conditionalComment.test(rest$1)
5840+
) {
58315841
// < in plain text, be forgiving and treat it as text
5832-
textEnd += rest$1.indexOf('<', 1);
5842+
next = rest$1.indexOf('<', 1);
5843+
if (next < 0) { break }
5844+
textEnd += next;
58335845
rest$1 = html.slice(textEnd);
58345846
}
58355847
text = html.substring(0, textEnd);
@@ -5865,8 +5877,9 @@ function parseHTML (html, options) {
58655877
parseEndTag('</' + stackedTag + '>', stackedTag, index - endTagLength, index);
58665878
}
58675879

5868-
if (html === last) {
5869-
throw new Error('Error parsing template:\n\n' + html)
5880+
if (html === last && options.chars) {
5881+
options.chars(html);
5882+
break
58705883
}
58715884
}
58725885

themes/vue/source/js/vue.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var fs = require('fs')
22
var version = require('../vue/package.json').version
33
var themeconfPath = 'themes/vue/_config.yml'
4-
var installPath = 'src/v2/guide/installation.md'
4+
var installPath = 'src/guide/installation.md'
55
var themeconfig = fs.readFileSync(themeconfPath, 'utf-8')
66
var installation = fs.readFileSync(installPath, 'utf-8')
77

0 commit comments

Comments
 (0)