-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Value.GetMemberKeys() does not include functions in class #678
Comments
Yes. Non enumerable JS properties currently don't show up in the member keys. We will change that but it needs some extension to our interop protocol, which will take a bit. |
I use CE RC5 version and looks like it works. One follow up question, is there any way to scan parameters of a function? in the example if I get Value representing the fuction by Value.getMember("setName"), can I scan parameters from the Value. I saw it has a member arguments, but when I try to getMember("arguments") it throws exception. |
To be more specific, originally I was using ee rc6 when having this issue. |
@MichaelHaibinXie yes it temporarily worked for RC5. But we had to roll back for RC6 as we have seen problems with this behavior. What exception does getMember it throw? |
I dont have the exception now as I switched to RC5. I will post later if I see it again. Thanks for help. Is there a way to scan parameters of member that is a function? |
@chumer Was this ever fixed? I still seem to be seeing the same problem in community RC14. If not, any estimate on when or if it might ever get fixed? To be clear i'm referring to the original problem reported in this issue, i.e. "Value.getMemberKeys() does not include functions in class" |
@quinton-hoole-2 Unfortunately no. It takes longer because it involves some interop protocol changes. The way to do this atm is by calling a JavaScript method that returns all the symbols. You can then read/write or invoke them. |
Thanks @chumer. We'll use that workaround in the mean time. |
Tracking internally as Issue GR-20913 |
hi @MichaelHaibinXie , this issue has been inactive for more than 180 days. We’ll close it to focus on current issues. In case it’s still relevant, please reopen it and we’ll take another look. Thank you! |
I have a function in class, Value.GetMember("functionName") returns true, however Value.getMemberKeys() does not include "functionName" in the keys.
Here is the code that I tried, any idea?
----------Test.java-----------
Value v = polyglot.eval(Source.newBuilder("js", new File(jsHome + "/college.js")).build());
Value v1 = polyglot.eval("js", "new College()");
// *****************this returns true
System.out.println("is there setName member? " + v1.hasMember("setName"));
// ******************Problem: this does not contain setName function
System.out.println("all member keys: " + v1.getMemberKeys());
----------College.js-----------
class College {
constructor() {
this.name = "defaultcollege";
this.students = [];
}
}
The text was updated successfully, but these errors were encountered: