A contrived example but it demonstrates the problem
Object.mixin({}, Proxy({ a: 5, b: 10, c: 20 }, {
getOwnPropertyDescriptor(target, key){
if (key === 'b' && Math.random() * .5) {
throw 'halt';
}
return Reflect.getOwnPropertyDescriptor(target, key);
}
}));
In ES5 rules there's no way to know whether 'c' will be in the returned
object or not, so that demonstrates actual non-determinism. The more common
case is a deterministic result that's unobvious to the developer as to be
nearly the same effective result.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss