8000 suppress simple path getter errors · Snoopbobb/vue@f7e571c · GitHub
[go: up one dir, main page]

Skip to content

Commit f7e571c

Browse files
committed
suppress simple path getter errors
1 parent 46812bd commit f7e571c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/api/data.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ var filterRE = /[^|]\|[^|]/
1616
exports.$get = function (exp) {
1717
var res = expParser.parse(exp)
1818
if (res) {
19-
try {
20-
return res.get.call(this, this)
21-
} catch (e) {}
19+
return res.get.call(this, this)
2220
}
2321
}
2422

src/parsers/path.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,15 @@ function formatAccessor(key) {
219219

220220
/**
221221
* Compiles a getter function with a fixed path.
222+
* The fixed path getter supresses errors.
222223
*
223224
* @param {Array} path
224225
* @return {Function}
225226
*/
226227

227228
exports.compileGetter = function (path) {
228229
var body = 'return o' + path.map(formatAccessor).join('')
229-
return new Function('o', body)
230+
return new Function('o', 'try {' + body + '} catch (e) {}')
230231
}
231232

232233
/**

0 commit comments

Comments
 (0)
0