Skip to content
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

getOwnPropertyDescriptor of Java wrapped objects getter/setter functions can not be invoked using "call"/"apply" #348

Closed
tmallery opened this issue Oct 16, 2017 · 1 comment

Comments

@tmallery
Copy link

I'm getting an error when I try to "call" the get/set properties of the result of Object.getOwnPropertyDescriptor() when a wrapped Java object is the target.

org.mozilla.v17.javascript.EvaluatorException: Can't find method org.mozilla.v17.javascript.Callable.call(object,string). (exp#69)
at org.mozilla.v17.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:77)
at org.mozilla.v17.javascript.Context.reportRuntimeError(Context.java:971)
at org.mozilla.v17.javascript.Context.reportRuntimeError(Context.java:1026)
at org.mozilla.v17.javascript.Context.reportRuntimeError1(Context.java:989)
at org.mozilla.v17.javascript.NativeJavaMethod.call(NativeJavaMethod.java:145)

In Chromes JS engine, the getter/setter properties of the object returned from Object.getOwnPropertyDescriptor() are functions which can then be executed using "call" and "apply". This is not true for Rhino because the get and set functions are MemberBox objects and not FunctionObjects.

@p-bakker
Copy link
Collaborator

@tmallery am closing this as I assume #353 fixed it. If not, please reopen

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

No branches or pull requests

2 participants