> Le 9 juin 2015 à 07:58, Edwin Reynoso <eor...@gmail.com> a écrit :
>
>
> **Or does someone know how to do what I'm trying to accomplish**
Maybe the following code goes in the direction of what you want?
```js
var people = new Proxy([new Person('Edwin', 'Reynoso'), new Person('That',
'Guy')], {
get(target, property) {
if (target[property] !== undefined)
return target[property];
var arr = [];
for (var person of target) arr.push(person[property]);
return new Proxy(arr, {
apply(target, thisArg, args) {
return target.map(item => Reflect.apply(item,
thisArg, args))
}
})
}
});
```
About your proposal, I recall that, at some point in the history of ES6 draft,
there was an `[[Invoke]]` MOP, and a corresponding `invoke` trap for proxies,
that were finally eliminated.
—Claude
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss