Selaa lähdekoodia

revert simple path error supression

Evan You 11 vuotta sitten
vanhempi
commit
ded967692b
2 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 3 1
      src/api/data.js
  2. 2 2
      src/parsers/path.js

+ 3 - 1
src/api/data.js

@@ -15,7 +15,9 @@ var filterRE = /[^|]\|[^|]/
 exports.$get = function (exp) {
   var res = expParser.parse(exp)
   if (res) {
-    return res.get.call(this, this)
+    try {
+      return res.get.call(this, this)
+    } catch (e) {}
   }
 }
 

+ 2 - 2
src/parsers/path.js

@@ -235,7 +235,7 @@ function formatAccessor (key) {
 
 exports.compileGetter = function (path) {
   var body = 'return o' + path.map(formatAccessor).join('')
-  return new Function('o', 'try {' + body + '} catch (e) {}')
+  return new Function('o', body)
 }
 
 /**
@@ -322,4 +322,4 @@ function warnNonExistent (path) {
     'with the "data" option for more reliable reactivity ' +
     'and better performance.'
   )
-}
+}