My ECMAScript 7 wishlist
Andrea Giammarchi
andrea.giammarchi at gmail.com
Sat Jun 7 10:25:48 PDT 2014
Interesting bug, thanks for the info.
In such case the only concern would be why `Object.prototype` is considered
but not inherited properties too.
If inheritance should be considered, I'd rather go like this:
```
var NoSuchProperty = Proxy({}, {
get: function(target, name, receiver) {
while (target = Object.getPrototypeOf(target)) {
if (name in target) {
return Reflect.get(target, name, receiver);
}
}
throw new TypeError(name + " is not a defined property");
}
});
```
Best Regards
On Sat, Jun 7, 2014 at 1:42 AM, André Bargull <andre.bargull at udo.edu> wrote:
> that `has:()=>true` breaks with features detections that are meant to be
>> less obtrusive than getters ... i.e. `'geolocation' in navigator` or
>> `'innerHTML' in genericNode` and all others that are not supposed to pass
>> through a potentially expensive getter to retrieve a feature detection
>> purpose info.
>>
>> Long story short that NoSuchProperty is obtrusive in an upside-down way
>> ...
>> I personally would not use that and would not expect that anywhere
>>
>
> The 'has' handler is required to work around a Firefox limitation. A
> compliant ES6 implementation only needs the 'get' handler.
>
> Related bug reports:
> https://bugzilla.mozilla.org/show_bug.cgi?id=914314
> https://bugzilla.mozilla.org/show_bug.cgi?id=1009199
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140607/9eb79ec9/attachment-0001.html>
More information about the es-discuss
mailing list