Status: New
Owner: ----
New issue 2145 by brandon.benvie: ES6: Proxy "keys"
and "getOwnPropertyNames" traps throw if any properties in Object.prototype
are returned
http://code.google.com/p/v8/issues/detail?id=2145
The keys and getOwnPropertyNames traps cannot report any properties that
exist in Object.prototype, even if the proxy's prototype is null, or they
will throw.
To reproduce:
<code language="javascript">
function broken(o){
return Proxy.create({
getOwnPropertyNames: function(){
return Object.getOwnPropertyNames(o);
},
keys: function(){
return Object.keys(o);
},
});
}
Object.keys(broken({ toString: function toString(){} }));
//TypeError: Trap 'undefined' returned repeated property name 'toString'
Object.getOwnPropertyNames(broken({ toString: function toString(){} }));
//TypeError: Trap 'getOwnPropertyNames' returned repeated property
name 'toString'
</code>
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev