fix indentation styles per eslint 1.5

This commit is contained in:
Evan You 2015-09-23 15:32:27 -04:00
parent d58a5b965b
commit ab9654b182
5 changed files with 53 additions and 38 deletions

View File

@ -118,13 +118,15 @@ exports.$interpolate = function (text) {
var tokens = textParser.parse(text)
var vm = this
if (tokens) {
return tokens.length === 1
? vm.$eval(tokens[0].value)
: tokens.map(function (token) {
return token.tag
? vm.$eval(token.value)
: token.value
}).join('')
if (tokens.length === 1) {
return vm.$eval(tokens[0].value)
} else {
return tokens.map(function (token) {
return token.tag
? vm.$eval(token.value)
: token.value
}).join('')
}
} else {
return text
}

View File

@ -1,6 +1,7 @@
var _ = require('./util')
var Watcher = require('./watcher')
var expParser = require('./parsers/expression')
function noop () {}
/**
* A directive links a DOM element with a piece of data,
@ -89,13 +90,15 @@ Directive.prototype._bind = function () {
) {
// wrapped updater for context
var dir = this
var update = this._update = this.update
? function (val, oldVal) {
if (!dir._locked) {
dir.update(val, oldVal)
}
if (this.update) {
this._update = function (val, oldVal) {
if (!dir._locked) {
dir.update(val, oldVal)
}
: function () {} // noop if no update is provided
}
} else {
this._update = noop
}
// pre-process hook called before the value is piped
// through the filters. used in v-for.
var preProcess = this._preProcess
@ -104,7 +107,7 @@ Directive.prototype._bind = function () {
var watcher = this._watcher = new Watcher(
this.vm,
this.expression,
update, // callback
this._update, // callback
{
filters: this.filters,
twoWay: this.twoWay,

View File

@ -26,11 +26,13 @@ exports.filterBy = function (arr, search, delimiter /* ...dataKeys */) {
return prev.concat(cur)
}, [])
return arr.filter(function (item) {
return keys.length
? keys.some(function (key) {
return contains(Path.get(item, key), search)
})
: contains(item, search)
if (keys.length) {
return keys.some(function (key) {
return contains(Path.get(item, key), search)
})
} else {
return contains(item, search)
}
})
}

View File

@ -156,22 +156,28 @@ function nodeToFragment (node) {
// Test for the presence of the Safari template cloning bug
// https://bugs.webkit.org/show_bug.cgi?id=137755
var hasBrokenTemplate = _.inBrowser
? (function () {
var a = document.createElement('div')
a.innerHTML = '<template>1</template>'
return !a.cloneNode(true).firstChild.innerHTML
})()
: false
var hasBrokenTemplate = (function () {
/* istanbul ignore else */
if (_.inBrowser) {
var a = document.createElement('div')
a.innerHTML = '<template>1</template>'
return !a.cloneNode(true).firstChild.innerHTML
} else {
return false
}
})()
// Test for IE10/11 textarea placeholder clone bug
var hasTextareaCloneBug = _.inBrowser
? (function () {
var t = document.createElement('textarea')
t.placeholder = 't'
return t.cloneNode(true).value === 't'
})()
: false
var hasTextareaCloneBug = (function () {
/* istanbul ignore else */
if (_.inBrowser) {
var t = document.createElement('textarea')
t.placeholder = 't'
return t.cloneNode(true).value === 't'
} else {
return false
}
})()
/**
* 1. Deal with Safari cloning nested <template> bug by

View File

@ -103,11 +103,13 @@ exports.parse = function (text) {
*/
exports.tokensToExp = function (tokens) {
return tokens.length > 1
? tokens.map(function (token) {
return formatToken(token)
}).join('+')
: formatToken(tokens[0], true)
if (tokens.length > 1) {
return tokens.map(function (token) {
return formatToken(token)
}).join('+')
} else {
return formatToken(tokens[0], true)
}
}
/**