Skip to content

Commit add8cc5

Browse files
committed
[release] 1.0.8
1 parent bcc1047 commit add8cc5

File tree

4 files changed

+129
-66
lines changed

4 files changed

+129
-66
lines changed

dist/vue.js

+123-60
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Vue.js v1.0.7
2+
* Vue.js v1.0.8
33
* (c) 2015 Evan You
44
* Released under the MIT License.
55
*/
@@ -146,7 +146,7 @@ return /******/ (function(modules) { // webpackBootstrap
146146
extend(p, __webpack_require__(65))
147147
extend(p, __webpack_require__(66))
148148

149-
Vue.version = '1.0.7'
149+
Vue.version = '1.0.8'
150150
module.exports = _.Vue = Vue
151151

152152
/* istanbul ignore if */
@@ -950,9 +950,11 @@ return /******/ (function(modules) { // webpackBootstrap
950950
*/
951951

952952
exports.createAnchor = function (content, persist) {
953-
return config.debug
953+
var anchor = config.debug
954954
? document.createComment(content)
955955
: document.createTextNode(persist ? ' ' : '')
956+
anchor.__vue_anchor = true
957+
return anchor
956958
}
957959

958960
/**
@@ -969,7 +971,6 @@ return /******/ (function(modules) { // webpackBootstrap
969971
for (var i = 0, l = attrs.length; i < l; i++) {
970972
var name = attrs[i].name
971973
if (refRE.test(name)) {
972-
node.removeAttribute(name)
973974
return _.camelize(name.replace(refRE, ''))
974975
}
975976
}
@@ -1063,6 +1064,14 @@ return /******/ (function(modules) { // webpackBootstrap
10631064

10641065
warnExpressionErrors: true,
10651066

1067+
/**
1068+
* Whether or not to handle fully object properties which
1069+
* are already backed by getters and seters. Depending on
1070+
* use case and environment, this might introduce non-neglible
1071+
* performance penalties.
1072+
*/
1073+
convertAllProperties: false,
1074+
10661075
/**
10671076
* Internal flag to indicate the delimiters have been
10681077
* changed.
@@ -1899,18 +1908,23 @@ return /******/ (function(modules) { // webpackBootstrap
18991908

19001909
function guardProps (options) {
19011910
var props = options.props
1902-
var i
1911+
var i, val
19031912
if (_.isArray(props)) {
19041913
options.props = {}
19051914
i = props.length
19061915
while (i--) {
1907-
options.props[props[i]] = null
1916+
val = props[i]
1917+
if (typeof val === 'string') {
1918+
options.props[val] = null
1919+
} else if (val.name) {
1920+
options.props[val.name] = val
1921+
}
19081922
}
19091923
} else if (_.isPlainObject(props)) {
19101924
var keys = Object.keys(props)
19111925
i = keys.length
19121926
while (i--) {
1913-
var val = props[keys[i]]
1927+
val = props[keys[i]]
19141928
if (typeof val === 'function') {
19151929
props[keys[i]] = { type: val }
19161930
}
@@ -2723,10 +2737,27 @@ return /******/ (function(modules) { // webpackBootstrap
27232737
*/
27242738

27252739
function compileTextNode (node, options) {
2726-
var tokens = textParser.parse(node.data)
2740+
// skip marked text nodes
2741+
if (node._skip) {
2742+
return removeText
2743+
}
2744+
2745+
var tokens = textParser.parse(node.wholeText)
27272746
if (!tokens) {
27282747
return null
27292748
}
2749+
2750+
// mark adjacent text nodes as skipped,
2751+
// because we are using node.wholeText to compile
2752+
// all adjacent text nodes together. This fixes
2753+
// issues in IE where sometimes it splits up a single
2754+
// text node into multiple ones.
2755+
var next = node.nextSibling
2756+
while (next && next.nodeType === 3) {
2757+
next._skip = true
2758+
next = next.nextSibling
2759+
}
2760+
27302761
var frag = document.createDocumentFragment()
27312762
var el, token
27322763
for (var i = 0, l = tokens.length; i < l; i++) {
@@ -2739,6 +2770,17 @@ return /******/ (function(modules) { // webpackBootstrap
27392770
return makeTextNodeLinkFn(tokens, frag, options)
27402771
}
27412772

2773+
/**
2774+
* Linker for an skipped text node.
2775+
*
2776+
* @param {Vue} vm
2777+
* @param {Text} node
2778+
*/
2779+
2780+
function removeText (vm, node) {
2781+
_.remove(node)
2782+
}
2783+
27422784
/**
27432785
* Process a single text token.
27442786
*
@@ -4217,7 +4259,10 @@ return /******/ (function(modules) { // webpackBootstrap
42174259
parentFrag.childFrags.push(this)
42184260
}
42194261
this.unlink = linker(vm, frag, host, scope, this)
4220-
var single = this.single = frag.childNodes.length === 1
4262+
var single = this.single =
4263+
frag.childNodes.length === 1 &&
4264+
// do not go single mode if the only node is an anchor
4265+
!(frag.childNodes[0].__vue_anchor)
42214266
if (single) {
42224267
this.node = frag.childNodes[0]
42234268
this.before = singleBefore
@@ -4474,15 +4519,9 @@ return /******/ (function(modules) { // webpackBootstrap
44744519
},
44754520

44764521
apply: function (el, value) {
4477-
function done () {
4522+
transition.apply(el, value ? 1 : -1, function () {
44784523
el.style.display = value ? '' : 'none'
4479-
}
4480-
// do not apply transition if not in doc
4481-
if (_.inDoc(el)) {
4482-
transition.apply(el, value ? 1 : -1, done, this.vm)
4483-
} else {
4484-
done()
4485-
}
4524+
}, this.vm)
44864525
}
44874526
}
44884527

@@ -4961,11 +5000,17 @@ return /******/ (function(modules) { // webpackBootstrap
49615000

49625001
function keyFilter (handler, keys) {
49635002
var codes = keys.map(function (key) {
4964-
var code = keyCodes[key]
4965-
if (!code) {
4966-
code = parseInt(key, 10)
5003+
var charCode = key.charCodeAt(0)
5004+
if (charCode > 47 && charCode < 58) {
5005+
return parseInt(key, 10)
5006+
}
5007+
if (key.length === 1) {
5008+
charCode = key.toUpperCase().charCodeAt(0)
5009+
if (charCode > 64 && charCode < 91) {
5010+
return charCode
5011+
}
49675012
}
4968-
return code
5013+
return keyCodes[key]
49695014
})
49705015
return function keyHandler (e) {
49715016
if (codes.indexOf(e.keyCode) > -1) {
@@ -5040,13 +5085,8 @@ return /******/ (function(modules) { // webpackBootstrap
50405085
}
50415086

50425087
this.reset()
5043-
var scope = this._scope || this.vm
5044-
this.handler = function (e) {
5045-
scope.$event = e
5046-
var res = handler(e)
5047-
scope.$event = null
5048-
return res
5049-
}
5088+
this.handler = handler
5089+
50505090
if (this.iframeBind) {
50515091
this.iframeBind()
50525092
} else {
@@ -5510,8 +5550,15 @@ return /******/ (function(modules) { // webpackBootstrap
55105550
// create a ref anchor
55115551
this.anchor = _.createAnchor('v-component')
55125552
_.replace(this.el, this.anchor)
5513-
// remove is attribute
5553+
// remove is attribute.
5554+
// this is removed during compilation, but because compilation is
5555+
// cached, when the component is used elsewhere this attribute
5556+
// will remain at link time.
55145557
this.el.removeAttribute('is')
5558+
// remove ref, same as above
5559+
if (this.descriptor.ref) {
5560+
this.el.removeAttribute('v-ref:' + _.hyphenate(this.descriptor.ref))
5561+
}
55155562
// if static, build right now.
55165563
if (this.literal) {
55175564
this.setComponent(this.expression)
@@ -6035,31 +6082,24 @@ return /******/ (function(modules) { // webpackBootstrap
60356082
}
60366083
// two-way sync for v-for alias
60376084
var forContext = scope.$forContext
6038-
if (true) {
6039-
if (
6040-
forContext &&
6041-
forContext.filters &&
6042-
(new RegExp(forContext.alias + '\\b')).test(this.expression)
6043-
) {
6044-
_.warn(
6085+
if (forContext && forContext.alias === this.expression) {
6086+
if (forContext.filters) {
6087+
("development") !== 'production' && _.warn(
60456088
'It seems you are using two-way binding on ' +
60466089
'a v-for alias (' + this.expression + '), and the ' +
60476090
'v-for has filters. This will not work properly. ' +
60486091
'Either remove the filters or use an array of ' +
60496092
'objects and bind to object properties instead.'
60506093
)
6094+
return
60516095
}
6052-
}
6053-
if (
6054-
forContext &&
6055-
forContext.alias === this.expression &&
6056-
!forContext.filters
6057-
) {
6058-
if (scope.$key) { // original is an object
6059-
forContext.rawValue[scope.$key] = value
6060-
} else {
6061-
forContext.rawValue.$set(scope.$index, value)
6062-
}
6096+
forContext._withLock(function () {
6097+
if (scope.$key) { // original is an object
6098+
forContext.rawValue[scope.$key] = value
6099+
} else {
6100+
forContext.rawValue.$set(scope.$index, value)
6101+
}
6102+
})
60636103
}
60646104
}
60656105

@@ -7435,8 +7475,8 @@ return /******/ (function(modules) { // webpackBootstrap
74357475

74367476
function isHidden (el) {
74377477
return !(
7438-
el.offsetWidth &&
7439-
el.offsetHeight &&
7478+
el.offsetWidth ||
7479+
el.offsetHeight ||
74407480
el.getClientRects().length
74417481
)
74427482
}
@@ -8660,7 +8700,7 @@ return /******/ (function(modules) { // webpackBootstrap
86608700
}
86618701

86628702
/**
8663-
* Swap the isntance's $data. Called in $data's setter.
8703+
* Swap the instance's $data. Called in $data's setter.
86648704
*
86658705
* @param {Object} newData
86668706
*/
@@ -8826,6 +8866,7 @@ return /******/ (function(modules) { // webpackBootstrap
88268866
/***/ function(module, exports, __webpack_require__) {
88278867

88288868
var _ = __webpack_require__(1)
8869+
var config = __webpack_require__(5)
88298870
var Dep = __webpack_require__(41)
88308871
var arrayMethods = __webpack_require__(59)
88318872
var arrayKeys = Object.getOwnPropertyNames(arrayMethods)
@@ -8874,7 +8915,7 @@ return /******/ (function(modules) { // webpackBootstrap
88748915
}
88758916
var ob
88768917
if (
8877-
value.hasOwnProperty('__ob__') &&
8918+
Object.prototype.hasOwnProperty.call(value, '__ob__') &&
88788919
value.__ob__ instanceof Observer
88798920
) {
88808921
ob = value.__ob__
@@ -8999,28 +9040,48 @@ return /******/ (function(modules) { // webpackBootstrap
89999040

90009041
function defineReactive (obj, key, val) {
90019042
var dep = new Dep()
9043+
9044+
// cater for pre-defined getter/setters
9045+
var getter, setter
9046+
if (config.convertAllProperties) {
9047+
var property = Object.getOwnPropertyDescriptor(obj, key)
9048+
if (property && property.configurable === false) {
9049+
return
9050+
}
9051+
getter = property && property.get
9052+
setter = property && property.set
9053+
}
9054+
90029055
var childOb = Observer.create(val)
90039056
Object.defineProperty(obj, key, {
90049057
enumerable: true,
90059058
configurable: true,
9006-
get: function metaGetter () {
9059+
get: function reactiveGetter () {
9060+
var value = getter ? getter.call(obj) : val
90079061
if (Dep.target) {
90089062
dep.depend()
90099063
if (childOb) {
90109064
childOb.dep.depend()
90119065
}
9012-
if (_.isArray(val)) {
9013-
for (var e, i = 0, l = val.length; i < l; i++) {
9014-
e = val[i]
9066+
if (_.isArray(value)) {
9067+
for (var e, i = 0, l = value.length; i < l; i++) {
9068+
e = value[i]
90159069
e && e.__ob__ && e.__ob__.dep.depend()
90169070
}
90179071
}
90189072
}
9019-
return val
9073+
return value
90209074
},
9021-
set: function metaSetter (newVal) {
9022-
if (newVal === val) return
9023-
val = newVal
9075+
set: function reactiveSetter (newVal) {
9076+
var value = getter ? getter.call(obj) : val
9077+
if (newVal === value) {
9078+
return
9079+
}
9080+
if (setter) {
9081+
setter.call(obj, newVal)
9082+
} else {
9083+
val = newVal
9084+
}
90249085
childOb = Observer.create(newVal)
90259086
dep.notify()
90269087
}
@@ -9595,8 +9656,10 @@ return /******/ (function(modules) { // webpackBootstrap
95959656
) {
95969657
var fn = expParser.parse(expression).get
95979658
var scope = this._scope || this.vm
9598-
var handler = function () {
9659+
var handler = function (e) {
9660+
scope.$event = e
95999661
fn.call(scope, scope)
9662+
scope.$event = null
96009663
}
96019664
if (this.filters) {
96029665
handler = scope._applyFilters(handler, null, this.filters)

dist/vue.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"author": "Evan You <[email protected]>",
55
"license": "MIT",
66
"description": "Simple, Fast & Composable MVVM for building interactive interfaces",

src/vue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extend(p, require('./api/dom'))
8585
extend(p, require('./api/events'))
8686
extend(p, require('./api/lifecycle'))
8787

88-
Vue.version = '1.0.7'
88+
Vue.version = '1.0.8'
8989
module.exports = _.Vue = Vue
9090

9191
/* istanbul ignore if */

0 commit comments

Comments
 (0)