Skip to content

Conversation

@marshall007
Copy link
Contributor

Supersedes #95 and eliminates a lot of the pitfalls I ran into with that first implementation. However, as discussed in #95, we still cannot do proxy instanceof Term directly. This is because the current implementation of Proxy in Node is not up to specification, nor is the appropriate behavior shimmed by harmony-reflect, as noted in their docs:

In full ES6 proxies, it is the intent that this trap is also triggered for proxy instanceof Function. This shim does not currently intercept that operation.

In the mean time, Term.isTerm checks for proxy._self instanceof Term which is nicer than setting a flag on the object as I was doing before. Once Proxy is fully implemented or shimmed up to spec, we can get rid of this and correctly trap the instanceof call.

TODO:

  • Check that Proxy is defined globally (i.e. available in current environment). If not, use existing behavior by modifying __proto__.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant