Hi,

On this webpage:
http://wiki.ecmascript.org/doku.php?id=harmony:proxies
They show this:

{
  has:       function(name) -> boolean                  // name in proxy
  hasOwn:    function(name) -> boolean                  //
({}).hasOwnProperty.call(proxy, name)
  get:       function(receiver, name) -> any            // receiver.name
  set:       function(receiver, name, val) -> boolean   // receiver.name = val
  enumerate: function() -> [string]                     // for (name
in proxy) (return array of enumerable own and inherited properties)
  keys:      function() -> [string]                     //
Object.keys(proxy)  (return array of enumerable own properties only)
}

How come the get and set traps get a receiver argument when the others don't?

I mean the only aim of having a receiver argument is to be able to use
the same "traps"object for several proxies and in fact, you can for
get and set traps. But it won't work on has, hasOwn and so on...

What's the reason for that?

Thank you in advance.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to