mirror of https://github.com/vuejs/vue.git
suppress simple path getter errors
This commit is contained in:
parent
46812bd210
commit
f7e571c468
|
|
@ -16,9 +16,7 @@ var filterRE = /[^|]\|[^|]/
|
|||
exports.$get = function (exp) {
|
||||
var res = expParser.parse(exp)
|
||||
if (res) {
|
||||
try {
|
||||
return res.get.call(this, this)
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ function formatAccessor(key) {
|
|||
|
||||
/**
|
||||
* Compiles a getter function with a fixed path.
|
||||
* The fixed path getter supresses errors.
|
||||
*
|
||||
* @param {Array} path
|
||||
* @return {Function}
|
||||
|
|
@ -226,7 +227,7 @@ function formatAccessor(key) {
|
|||
|
||||
exports.compileGetter = function (path) {
|
||||
var body = 'return o' + path.map(formatAccessor).join('')
|
||||
return new Function('o', body)
|
||||
return new Function('o', 'try {' + body + '} catch (e) {}')
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue