Replies: 1 comment 2 replies
-
Can you show a minimal repro of the approach you are using to gain the features you need? I'd like to see the "bigger picture" how you utilize the inheritance and why. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a project that integrates with Jint but has its own interop infrastructure (the code was originally written to integrate with a different JS engine and later modified to work with Jint). The interop code relies on subclassing Jint's
Function
class. With an earlier version of Jint this was not an issue, but in trying to update the code to work with Jint 3.x, I've run into the following problem: the constructorprotected Function(Engine engine, Realm realm, JsString? name)
requiresrealm
, which was previously available viaengine.Realm
, but in Jint 3.xengine.Realm
has been made internal.It seems that
Function
is not really intended to be subclassed by consumers of Jint now, but if not, what approaches are possible for custom interop? I see that there is aClrFunction
class, but it is designed to work with a delegate and is sealed to prevent subclassing. In an ideal world this might be sufficient, but here I am working with an existing class hierarchy based onFunction
, and converting to a delegate-based solution would require a significant amount of rework.It would be nice to have the option of subclassing
Function
- or something like it - to provide more flexibility for interop design.Beta Was this translation helpful? Give feedback.
All reactions