[[Invoke]] vs [[Get]]

Brian Di Palma offler at gmail.com
Sun Jun 9 10:26:20 PDT 2013

On Sun, Jun 9, 2013 at 4:18 PM, Tom Van Cutsem <tomvc.be at gmail.com> wrote:
> No, we can't just blindly call GetValue in step 1 as that would lead to the
> "get" trap being invoked on a proxy (which is the wrong trap).

Why can't we have the two traps trigger?

I would imagine that proxies are meant to be consistent with getters/setters?
So in this example obj.f() triggers the getter, yet if I understand
what you're advocating it wouldn't trigger a [[Get]] trap?

var obj = { get f() {
  console.info( "getter called." );
  return console.info.bind(console);
} }

obj.f( "getter also called" )

> "getter called."
> "getter also called"

Surely if these names where to be consistent for proxies then a get
trap followed by an invoke trap should be fired?

More information about the es-discuss mailing list