Closed lydell closed 9 years ago
Good suggestion. But seems proxy in ES5 is not such simple? As I know, in ES5 it's not easy to catch a undefined property of a certain object.
Proxy
is an ES6 feature. There is nothing we can do in ES5. The idea of the proxy
function is to only use a Proxy
if available. Otherwise there should be no difference.
Move discussion to https://github.com/shouldjs/should.js/issues/35
By wrapping the return value of the
should
function in aProxy
such errors could be caught.Something like this: