-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GR-54959] ProxyInstantiable
carries no class information
#9167
Comments
Hi @sgammon , thanks for reaching out to us. We'll be taking a look into this shortly |
ProxyInstantiable
carries no class informationProxyInstantiable
carries no class information
In fact, constructors (in JavaScript) can return arbitrary objects and you can abuse that to implement what you need using something like
Would that work for you? |
@iamstolis Lol. JavaScript never ceases to amaze. I updated my description. This will work for us for now, yes, but this approach generally requires us to execute preparatory code in the guest context before executing actual guest code which relies on Ideally, we'd be able to inject a type from the host context, without resorting to guest code. It would be really cool to make |
I am sorry, I don't understand why exactly are you more concerned by the execution of preparatory code compared to the usage of methods of |
Describe the issue
I want to create polyglot-capable objects with a
ProxyInstantiable
, but I also want such objects to pass type checks in guest languages.Code snippet or code repository that reproduces the issue
Later, in a guest language...
Additional context
I've considered the alternative of a facade guest type, like:
But this requires up-front execution of preparatory code in the guest context.
I've also tried installing the host type directly, but then I must register my constructors for reflective access, and I must share host constructors with guest constructors, which especially complicates instantiation with
varargs Value
. The flexibility ofProxyInstantiable
, which allowsvararg Value
, is especially useful for interop with JavaScript, but is hard to adapt to type checks.The text was updated successfully, but these errors were encountered: