Skip to content

Commit 78bbb47

Browse files
committed
[build] 1.0.25
1 parent d5c46b5 commit 78bbb47

File tree

5 files changed

+147
-69
lines changed

5 files changed

+147
-69
lines changed

dist/vue.common.js

+70-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v1.0.24
2+
* Vue.js v1.0.25
33
* (c) 2016 Evan You
44
* Released under the MIT License.
55
*/
@@ -398,10 +398,15 @@ var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
398398

399399
// UA sniffing for working around browser-specific quirks
400400
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
401+
var isIE = UA && UA.indexOf('trident') > 0;
401402
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
402403
var isAndroid = UA && UA.indexOf('android') > 0;
403404
var isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA);
404-
var isWechat = UA && UA.indexOf('micromessenger') > 0;
405+
var iosVersionMatch = isIos && UA.match(/os ([\d_]+)/);
406+
var iosVersion = iosVersionMatch && iosVersionMatch[1].split('_');
407+
408+
// detecting iOS UIWebView by indexedDB
409+
var hasMutationObserverBug = iosVersion && Number(iosVersion[0]) >= 9 && Number(iosVersion[1]) >= 3 && !window.indexedDB;
405410

406411
var transitionProp = undefined;
407412
var transitionEndEvent = undefined;
@@ -442,7 +447,7 @@ var nextTick = (function () {
442447
}
443448

444449
/* istanbul ignore if */
445-
if (typeof MutationObserver !== 'undefined' && !(isWechat && isIos)) {
450+
if (typeof MutationObserver !== 'undefined' && !hasMutationObserverBug) {
446451
var counter = 1;
447452
var observer = new MutationObserver(nextTickHandler);
448453
var textNode = document.createTextNode(counter);
@@ -514,12 +519,12 @@ var p = Cache.prototype;
514519

515520
p.put = function (key, value) {
516521
var removed;
517-
if (this.size === this.limit) {
518-
removed = this.shift();
519-
}
520522

521523
var entry = this.get(key, true);
522524
if (!entry) {
525+
if (this.size === this.limit) {
526+
removed = this.shift();
527+
}
523528
entry = {
524529
key: key
525530
};
@@ -764,7 +769,7 @@ function compileRegex() {
764769
var unsafeOpen = escapeRegex(config.unsafeDelimiters[0]);
765770
var unsafeClose = escapeRegex(config.unsafeDelimiters[1]);
766771
tagRE = new RegExp(unsafeOpen + '((?:.|\\n)+?)' + unsafeClose + '|' + open + '((?:.|\\n)+?)' + close, 'g');
767-
htmlRE = new RegExp('^' + unsafeOpen + '.*' + unsafeClose + '$');
772+
htmlRE = new RegExp('^' + unsafeOpen + '((?:.|\\n)+?)' + unsafeClose + '$');
768773
// reset cache
769774
cache = new Cache(1000);
770775
}
@@ -1551,7 +1556,8 @@ if (process.env.NODE_ENV !== 'production') {
15511556
return (/HTMLUnknownElement/.test(el.toString()) &&
15521557
// Chrome returns unknown for several HTML5 elements.
15531558
// https://code.google.com/p/chromium/issues/detail?id=540526
1554-
!/^(data|time|rtc|rb)$/.test(tag)
1559+
// Firefox returns unknown for some "Interactive elements."
1560+
!/^(data|time|rtc|rb|details|dialog|summary)$/.test(tag)
15551561
);
15561562
}
15571563
};
@@ -1887,7 +1893,9 @@ function mergeOptions(parent, child, vm) {
18871893
}
18881894
if (child.mixins) {
18891895
for (var i = 0, l = child.mixins.length; i < l; i++) {
1890-
parent = mergeOptions(parent, child.mixins[i], vm);
1896+
var mixin = child.mixins[i];
1897+
var mixinOptions = mixin.prototype instanceof Vue ? mixin.options : mixin;
1898+
parent = mergeOptions(parent, mixinOptions, vm);
18911899
}
18921900
}
18931901
for (key in parent) {
@@ -2315,10 +2323,13 @@ var util = Object.freeze({
23152323
hasProto: hasProto,
23162324
inBrowser: inBrowser,
23172325
devtools: devtools,
2326+
isIE: isIE,
23182327
isIE9: isIE9,
23192328
isAndroid: isAndroid,
23202329
isIos: isIos,
2321-
isWechat: isWechat,
2330+
iosVersionMatch: iosVersionMatch,
2331+
iosVersion: iosVersion,
2332+
hasMutationObserverBug: hasMutationObserverBug,
23222333
get transitionProp () { return transitionProp; },
23232334
get transitionEndEvent () { return transitionEndEvent; },
23242335
get animationProp () { return animationProp; },
@@ -2806,7 +2817,9 @@ var saveRE = /[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\
28062817
var restoreRE = /"(\d+)"/g;
28072818
var pathTestRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/;
28082819
var identRE = /[^\w$\.](?:[A-Za-z_$][\w$]*)/g;
2809-
var booleanLiteralRE = /^(?:true|false)$/;
2820+
var literalValueRE$1 = /^(?:true|false|null|undefined|Infinity|NaN)$/;
2821+
2822+
function noop() {}
28102823

28112824
/**
28122825
* Save / Rewrite / Restore
@@ -2888,7 +2901,7 @@ function compileGetter(exp) {
28882901
// save strings and object literal keys
28892902
var body = exp.replace(saveRE, save).replace(wsRE, '');
28902903
// rewrite all paths
2891-
// pad 1 space here becaue the regex matches 1 extra char
2904+
// pad 1 space here because the regex matches 1 extra char
28922905
body = (' ' + body).replace(identRE, rewrite).replace(restoreRE, restore);
28932906
return makeGetterFn(body);
28942907
}
@@ -2909,7 +2922,15 @@ function makeGetterFn(body) {
29092922
return new Function('scope', 'return ' + body + ';');
29102923
/* eslint-enable no-new-func */
29112924
} catch (e) {
2912-
process.env.NODE_ENV !== 'production' && warn('Invalid expression. ' + 'Generated function body: ' + body);
2925+
if (process.env.NODE_ENV !== 'production') {
2926+
/* istanbul ignore if */
2927+
if (e.toString().match(/unsafe-eval|CSP/)) {
2928+
warn('It seems you are using the default build of Vue.js in an environment ' + 'with Content Security Policy that prohibits unsafe-eval. ' + 'Use the CSP-compliant build instead: ' + 'http://vuejs.org/guide/installation.html#CSP-compliant-build');
2929+
} else {
2930+
warn('Invalid expression. ' + 'Generated function body: ' + body);
2931+
}
2932+
}
2933+
return noop;
29132934
}
29142935
}
29152936

@@ -2971,8 +2992,8 @@ function parseExpression(exp, needSet) {
29712992

29722993
function isSimplePath(exp) {
29732994
return pathTestRE.test(exp) &&
2974-
// don't treat true/false as paths
2975-
!booleanLiteralRE.test(exp) &&
2995+
// don't treat literal values as paths
2996+
!literalValueRE$1.test(exp) &&
29762997
// Math constants e.g. Math.PI, Math.E etc.
29772998
exp.slice(0, 5) !== 'Math.';
29782999
}
@@ -3451,6 +3472,7 @@ function isRealTemplate(node) {
34513472

34523473
var tagRE$1 = /<([\w:-]+)/;
34533474
var entityRE = /&#?\w+?;/;
3475+
var commentRE = /<!--/;
34543476

34553477
/**
34563478
* Convert a string template to a DocumentFragment.
@@ -3473,8 +3495,9 @@ function stringToFragment(templateString, raw) {
34733495
var frag = document.createDocumentFragment();
34743496
var tagMatch = templateString.match(tagRE$1);
34753497
var entityMatch = entityRE.test(templateString);
3498+
var commentMatch = commentRE.test(templateString);
34763499

3477-
if (!tagMatch && !entityMatch) {
3500+
if (!tagMatch && !entityMatch && !commentMatch) {
34783501
// text only, return a single text node.
34793502
frag.appendChild(document.createTextNode(templateString));
34803503
} else {
@@ -4441,7 +4464,7 @@ var vFor = {
44414464
* the filters. This is passed to and called by the watcher.
44424465
*
44434466
* It is necessary for this to be called during the
4444-
* wathcer's dependency collection phase because we want
4467+
* watcher's dependency collection phase because we want
44454468
* the v-for to update when the source Object is mutated.
44464469
*/
44474470

@@ -4784,7 +4807,10 @@ var text$2 = {
47844807
},
47854808

47864809
update: function update(value) {
4787-
this.el.value = _toString(value);
4810+
// #3029 only update when the value changes. This prevent
4811+
// browsers from overwriting values like selectionStart
4812+
value = _toString(value);
4813+
if (value !== this.el.value) this.el.value = value;
47884814
},
47894815

47904816
unbind: function unbind() {
@@ -4833,6 +4859,8 @@ var radio = {
48334859
var select = {
48344860

48354861
bind: function bind() {
4862+
var _this = this;
4863+
48364864
var self = this;
48374865
var el = this.el;
48384866

@@ -4864,11 +4892,16 @@ var select = {
48644892
// selectedIndex with value -1 to 0 when the element
48654893
// is appended to a new parent, therefore we have to
48664894
// force a DOM update whenever that happens...
4867-
this.vm.$on('hook:attached', this.forceUpdate);
4895+
this.vm.$on('hook:attached', function () {
4896+
nextTick(_this.forceUpdate);
4897+
});
48684898
},
48694899

48704900
update: function update(value) {
48714901
var el = this.el;
4902+
if (!inDoc(el)) {
4903+
return nextTick(this.forceUpdate);
4904+
}
48724905
el.selectedIndex = -1;
48734906
var multi = this.multiple && isArray(value);
48744907
var options = el.options;
@@ -6134,7 +6167,7 @@ function processPropValue(vm, prop, rawValue, fn) {
61346167
if (value === undefined) {
61356168
value = getPropDefaultValue(vm, prop);
61366169
}
6137-
value = coerceProp(prop, value);
6170+
value = coerceProp(prop, value, vm);
61386171
var coerced = value !== rawValue;
61396172
if (!assertProp(prop, value, vm)) {
61406173
value = undefined;
@@ -6253,13 +6286,17 @@ function assertProp(prop, value, vm) {
62536286
* @return {*}
62546287
*/
62556288

6256-
function coerceProp(prop, value) {
6289+
function coerceProp(prop, value, vm) {
62576290
var coerce = prop.options.coerce;
62586291
if (!coerce) {
62596292
return value;
62606293
}
6261-
// coerce is a function
6262-
return coerce(value);
6294+
if (typeof coerce === 'function') {
6295+
return coerce(value);
6296+
} else {
6297+
process.env.NODE_ENV !== 'production' && warn('Invalid coerce for prop "' + prop.name + '": expected function, got ' + typeof coerce + '.', vm);
6298+
return value;
6299+
}
62636300
}
62646301

62656302
/**
@@ -6791,10 +6828,9 @@ var transition$1 = {
67916828
// resolve on owner vm
67926829
var hooks = resolveAsset(this.vm.$options, 'transitions', id);
67936830
id = id || 'v';
6831+
oldId = oldId || 'v';
67946832
el.__v_trans = new Transition(el, id, hooks, this.vm);
6795-
if (oldId) {
6796-
removeClass(el, oldId + '-transition');
6797-
}
6833+
removeClass(el, oldId + '-transition');
67986834
addClass(el, id + '-transition');
67996835
}
68006836
};
@@ -7219,7 +7255,7 @@ function makeTextNodeLinkFn(tokens, frag) {
72197255
if (token.html) {
72207256
replace(node, parseTemplate(value, true));
72217257
} else {
7222-
node.data = value;
7258+
node.data = _toString(value);
72237259
}
72247260
} else {
72257261
vm._bindDir(token.descriptor, node, host, scope);
@@ -8203,7 +8239,7 @@ function eventsMixin (Vue) {
82038239
};
82048240
}
82058241

8206-
function noop() {}
8242+
function noop$1() {}
82078243

82088244
/**
82098245
* A directive links a DOM element with a piece of data,
@@ -8302,7 +8338,7 @@ Directive.prototype._bind = function () {
83028338
}
83038339
};
83048340
} else {
8305-
this._update = noop;
8341+
this._update = noop$1;
83068342
}
83078343
var preProcess = this._preProcess ? bind(this._preProcess, this) : null;
83088344
var postProcess = this._postProcess ? bind(this._postProcess, this) : null;
@@ -9740,7 +9776,7 @@ var filters = {
97409776

97419777
json: {
97429778
read: function read(value, indent) {
9743-
return typeof value === 'string' ? value : JSON.stringify(value, null, Number(indent) || 2);
9779+
return typeof value === 'string' ? value : JSON.stringify(value, null, arguments.length > 1 ? indent : 2);
97449780
},
97459781
write: function write(value) {
97469782
try {
@@ -9998,7 +10034,9 @@ function installGlobalAPI (Vue) {
999810034
}
999910035
}
1000010036
if (type === 'component' && isPlainObject(definition)) {
10001-
definition.name = id;
10037+
if (!definition.name) {
10038+
definition.name = id;
10039+
}
1000210040
definition = Vue.extend(definition);
1000310041
}
1000410042
this.options[type + 's'][id] = definition;
@@ -10013,7 +10051,7 @@ function installGlobalAPI (Vue) {
1001310051

1001410052
installGlobalAPI(Vue);
1001510053

10016-
Vue.version = '1.0.24';
10054+
Vue.version = '1.0.25';
1001710055

1001810056
// devtools global hook
1001910057
/* istanbul ignore next */

0 commit comments

Comments
 (0)