instanceof trap and default handler for Proxies

# Tom Van Cutsem (15 years ago)

I created a strawman page to host possible extensions to harmony:proxies: strawman:proxy_extensions

It currently hosts two extensions:

  • enabling proxies to trap instanceof
  • standardizing the default "no-op" forwarding handler

At least the first will be on the agenda for the November TC39 meeting.

Please comment and discuss.

# Kam Kasravi (15 years ago)

How 'bout extending proxies to provide an introspection API?

# Kam Kasravi (15 years ago)

I assume the answer is no, but can one proxy simple modules?

# David Herman (15 years ago)

How 'bout extending proxies to provide an introspection API?

That's a really vague question. It would help to say what kind of introspection you had in mind.

# David Herman (15 years ago)

I assume the answer is no, but can one proxy simple modules?

I can think of two ways to read this question. If you mean "can one simulate simple modules with proxies" the answer is no -- you can't dynamically simulate something with static semantics. If you mean "can one create a proxy that delegates to a module" the answer is yes: because simple modules can be reflected as objects at runtime, you can use any kind of dynamic delegation patterns you like, including via proxies.

# Tom Van Cutsem (15 years ago)

How 'bout extending proxies to provide an introspection API?

I'm not sure what you mean by this. Javascript's built-in features + the many built-ins defined on Object already provide ample support for introspection on objects (and proxied objects).

# Kam Kasravi (15 years ago)

Perhaps more of a question for Dave but I was hoping for something more integrated with modules and types which would also expose closures, perhaps based on the FF4 experimental Reflect API.

Also I know traits had extended the property descriptor to include required, in such cases it might be valuable to do this generically eg to a propert descriptor prototype