Skip to content

Commit 8c77fb8

Browse files
committed
[build] 1.0.13
1 parent 03b580e commit 8c77fb8

File tree

4 files changed

+123
-129
lines changed

4 files changed

+123
-129
lines changed

dist/vue.common.js

+59-62
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v1.0.12
2+
* Vue.js v1.0.13
33
* (c) 2015 Evan You
44
* Released under the MIT License.
55
*/
@@ -847,22 +847,10 @@ function inlineFilters(exp, single) {
847847
}
848848
}
849849

850-
/**
851-
* Replace all interpolation tags in a piece of text.
852-
*
853-
* @param {String} text
854-
* @return {String}
855-
*/
856-
857-
function removeTags(text) {
858-
return text.replace(tagRE, '');
859-
}
860-
861850
var text$1 = Object.freeze({
862851
compileRegex: compileRegex,
863852
parseText: parseText,
864-
tokensToExp: tokensToExp,
865-
removeTags: removeTags
853+
tokensToExp: tokensToExp
866854
});
867855

868856
var delimiters = ['{{', '}}'];
@@ -1963,7 +1951,7 @@ var arrayMethods = Object.create(arrayProto)
19631951

19641952
def(arrayProto, '$set', function $set(index, val) {
19651953
if (index >= this.length) {
1966-
this.length = index + 1;
1954+
this.length = Number(index) + 1;
19671955
}
19681956
return this.splice(index, 1, val)[0];
19691957
});
@@ -2079,8 +2067,7 @@ function Observer(value) {
20792067

20802068
Observer.prototype.walk = function (obj) {
20812069
var keys = Object.keys(obj);
2082-
var i = keys.length;
2083-
while (i--) {
2070+
for (var i = 0, l = keys.length; i < l; i++) {
20842071
this.convert(keys[i], obj[keys[i]]);
20852072
}
20862073
};
@@ -2092,8 +2079,7 @@ Observer.prototype.walk = function (obj) {
20922079
*/
20932080

20942081
Observer.prototype.observeArray = function (items) {
2095-
var i = items.length;
2096-
while (i--) {
2082+
for (var i = 0, l = items.length; i < l; i++) {
20972083
observe(items[i]);
20982084
}
20992085
};
@@ -2157,10 +2143,8 @@ function protoAugment(target, src) {
21572143
*/
21582144

21592145
function copyAugment(target, src, keys) {
2160-
var i = keys.length;
2161-
var key;
2162-
while (i--) {
2163-
key = keys[i];
2146+
for (var i = 0, l = keys.length; i < l; i++) {
2147+
var key = keys[i];
21642148
def(target, key, src[key]);
21652149
}
21662150
}
@@ -3344,7 +3328,7 @@ function traverse(val) {
33443328
var cloak = {
33453329
bind: function bind() {
33463330
var el = this.el;
3347-
this.vm.$once('hook:compiled', function () {
3331+
this.vm.$once('pre-hook:compiled', function () {
33483332
el.removeAttribute('v-cloak');
33493333
});
33503334
}
@@ -3356,9 +3340,20 @@ var ref = {
33563340
}
33573341
};
33583342

3343+
var ON = 700;
3344+
var MODEL = 800;
3345+
var BIND = 850;
3346+
var TRANSITION = 1100;
3347+
var EL = 1500;
3348+
var COMPONENT = 1500;
3349+
var PARTIAL = 1750;
3350+
var SLOT = 1750;
3351+
var FOR = 2000;
3352+
var IF = 2000;
3353+
33593354
var el = {
33603355

3361-
priority: 1500,
3356+
priority: EL,
33623357

33633358
bind: function bind() {
33643359
/* istanbul ignore if */
@@ -3509,7 +3504,7 @@ var modelProps = {
35093504

35103505
var bind = {
35113506

3512-
priority: 850,
3507+
priority: BIND,
35133508

35143509
bind: function bind() {
35153510
var attr = this.arg;
@@ -3559,34 +3554,43 @@ var bind = {
35593554
handleObject: style.handleObject,
35603555

35613556
handleSingle: function handleSingle(attr, value) {
3562-
if (!this.descriptor.interp && attrWithPropsRE.test(attr) && attr in this.el) {
3563-
this.el[attr] = attr === 'value' ? value == null // IE9 will set input.value to "null" for null...
3557+
var el = this.el;
3558+
var interp = this.descriptor.interp;
3559+
if (!interp && attrWithPropsRE.test(attr) && attr in el) {
3560+
el[attr] = attr === 'value' ? value == null // IE9 will set input.value to "null" for null...
35643561
? '' : value : value;
35653562
}
35663563
// set model props
35673564
var modelProp = modelProps[attr];
3568-
if (modelProp) {
3569-
this.el[modelProp] = value;
3565+
if (!interp && modelProp) {
3566+
el[modelProp] = value;
35703567
// update v-model if present
3571-
var model = this.el.__v_model;
3568+
var model = el.__v_model;
35723569
if (model) {
35733570
model.listener();
35743571
}
35753572
}
35763573
// do not set value attribute for textarea
3577-
if (attr === 'value' && this.el.tagName === 'TEXTAREA') {
3578-
this.el.removeAttribute(attr);
3574+
if (attr === 'value' && el.tagName === 'TEXTAREA') {
3575+
el.removeAttribute(attr);
35793576
return;
35803577
}
35813578
// update attribute
35823579
if (value != null && value !== false) {
3583-
if (xlinkRE.test(attr)) {
3584-
this.el.setAttributeNS(xlinkNS, attr, value);
3580+
if (attr === 'class') {
3581+
// handle edge case #1960:
3582+
// class interpolation should not overwrite Vue transition class
3583+
if (el.__v_trans) {
3584+
value += ' ' + el.__v_trans.id + '-transition';
3585+
}
3586+
setClass(el, value);
3587+
} else if (xlinkRE.test(attr)) {
3588+
el.setAttributeNS(xlinkNS, attr, value);
35853589
} else {
3586-
this.el.setAttribute(attr, value);
3590+
el.setAttribute(attr, value);
35873591
}
35883592
} else {
3589-
this.el.removeAttribute(attr);
3593+
el.removeAttribute(attr);
35903594
}
35913595
}
35923596
};
@@ -3642,7 +3646,7 @@ function preventFilter(handler) {
36423646
var on = {
36433647

36443648
acceptStatement: true,
3645-
priority: 700,
3649+
priority: ON,
36463650

36473651
bind: function bind() {
36483652
// deal with iframes
@@ -4033,7 +4037,7 @@ var handlers = {
40334037

40344038
var model = {
40354039

4036-
priority: 800,
4040+
priority: MODEL,
40374041
twoWay: true,
40384042
handlers: handlers,
40394043
params: ['lazy', 'number', 'debounce'],
@@ -4605,7 +4609,7 @@ FragmentFactory.prototype.create = function (host, scope, parentFrag) {
46054609

46064610
var vIf = {
46074611

4608-
priority: 2000,
4612+
priority: IF,
46094613

46104614
bind: function bind() {
46114615
var el = this.el;
@@ -4668,7 +4672,7 @@ var uid$1 = 0;
46684672

46694673
var vFor = {
46704674

4671-
priority: 2000,
4675+
priority: FOR,
46724676

46734677
params: ['track-by', 'stagger', 'enter-stagger', 'leave-stagger'],
46744678

@@ -5663,7 +5667,7 @@ function isHidden(el) {
56635667

56645668
var transition = {
56655669

5666-
priority: 1100,
5670+
priority: TRANSITION,
56675671

56685672
update: function update(id, oldId) {
56695673
var el = this.el;
@@ -5714,7 +5718,7 @@ var propDef = {
57145718
// important: defer the child watcher creation until
57155719
// the created hook (after data observation)
57165720
var self = this;
5717-
child.$once('hook:created', function () {
5721+
child.$once('pre-hook:created', function () {
57185722
self.childWatcher = new Watcher(child, childKey, function (val) {
57195723
parentWatcher.set(val);
57205724
}, {
@@ -5737,7 +5741,7 @@ var propDef = {
57375741

57385742
var component = {
57395743

5740-
priority: 1500,
5744+
priority: COMPONENT,
57415745

57425746
params: ['keep-alive', 'transition-mode', 'inline-template'],
57435747

@@ -6930,12 +6934,8 @@ function compileDirectives(attrs, options) {
69306934
// attribute interpolations
69316935
if (tokens) {
69326936
value = tokensToExp(tokens);
6933-
if (name === 'class') {
6934-
pushDir('class', internalDirectives['class'], true);
6935-
} else {
6936-
arg = name;
6937-
pushDir('bind', publicDirectives.bind, true);
6938-
}
6937+
arg = name;
6938+
pushDir('bind', publicDirectives.bind, true);
69396939
// warn against mixing mustaches with v-bind
69406940
if (process.env.NODE_ENV !== 'production') {
69416941
if (name === 'class' && Array.prototype.some.call(attrs, function (attr) {
@@ -7596,6 +7596,7 @@ function eventsMixin (Vue) {
75967596
*/
75977597

75987598
Vue.prototype._callHook = function (hook) {
7599+
this.$emit('pre-hook:' + hook);
75997600
var handlers = this.$options[hook];
76007601
if (handlers) {
76017602
for (var i = 0, j = handlers.length; i < j; i++) {
@@ -7672,13 +7673,7 @@ Directive.prototype._bind = function () {
76727673
// remove attribute
76737674
if ((name !== 'cloak' || this.vm._isCompiled) && this.el && this.el.removeAttribute) {
76747675
var attr = descriptor.attr || 'v-' + name;
7675-
if (attr !== 'class') {
7676-
this.el.removeAttribute(attr);
7677-
} else {
7678-
// for class interpolations, only remove the parts that
7679-
// need to be interpolated.
7680-
setClass(this.el, removeTags(this.el.getAttribute('class')).trim().replace(/\s+/g, ' '));
7681-
}
7676+
this.el.removeAttribute(attr);
76827677
}
76837678

76847679
// copy def properties
@@ -7788,7 +7783,8 @@ Directive.prototype._setupParamWatcher = function (key, expression) {
77887783
called = true;
77897784
}
77907785
}, {
7791-
immediate: true
7786+
immediate: true,
7787+
user: false
77927788
});(this._paramUnwatchFns || (this._paramUnwatchFns = [])).push(unwatch);
77937789
};
77947790

@@ -8477,7 +8473,8 @@ function dataAPI (Vue) {
84778473
var watcher = new Watcher(vm, expOrFn, cb, {
84788474
deep: options && options.deep,
84798475
sync: options && options.sync,
8480-
filters: parsed && parsed.filters
8476+
filters: parsed && parsed.filters,
8477+
user: !options || options.user !== false
84818478
});
84828479
if (options && options.immediate) {
84838480
cb.call(vm, watcher.value);
@@ -9241,7 +9238,7 @@ var filters = {
92419238

92429239
var partial = {
92439240

9244-
priority: 1750,
9241+
priority: PARTIAL,
92459242

92469243
params: ['name'],
92479244

@@ -9292,7 +9289,7 @@ var partial = {
92929289

92939290
var slot = {
92949291

9295-
priority: 1750,
9292+
priority: SLOT,
92969293

92979294
bind: function bind() {
92989295
var host = this.vm;
@@ -9397,7 +9394,7 @@ var elementDirectives = {
93979394
partial: partial
93989395
};
93999396

9400-
Vue.version = '1.0.12';
9397+
Vue.version = '1.0.13';
94019398

94029399
/**
94039400
* Vue and every constructor that extends Vue has an

0 commit comments

Comments
 (0)