You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, guys. I'm migrating an application from Rhino to Graal and I'm stuck trying to reproduce some behaviors of JS Arrays that was possible on Rhino. Here's a simple test example that emulates my problem:
This code throws the Exception: TypeError: writeMember (length) ..... Message not supported. This exception throws only by passing the proxy as the function parameter. Some JS Array methods, like .push() and .pop(), do not work in this scenario too. Any idea that what could be done to allow this attribution?
The text was updated successfully, but these errors were encountered:
The support for writing the length property of foreign (= non-JavaScript arrays) has been implemented by e3582e2.
Your test-case will throw TypeError still because ProxyArray.fromList(Arrays.asList(1, 2, 3, 4, 5)) does not support the removal of its members (because Arrays.asList(1, 2, 3, 4, 5) does not support remove() operation). On the other hand, the test-case should work (with the mentioned fix) if you use ProxyArray.fromList() with a list that supports remove() (or if you use a custom implementation of ProxyArray that supports removal/addition of elements).
Some JS Array methods, like .push() and .pop(), do not work in this scenario too.
Array.prototype.push and Array.prototype.pop should work fine with a foreign array if the array supports the removal/addition of an element. Note that this is not the case for ProxyArray.fromList() (which does not support the addition of an element).
Hello, guys. I'm migrating an application from Rhino to Graal and I'm stuck trying to reproduce some behaviors of JS Arrays that was possible on Rhino. Here's a simple test example that emulates my problem:
This code throws the Exception:
TypeError: writeMember (length) ..... Message not supported
. This exception throws only by passing the proxy as the function parameter. Some JS Array methods, like .push() and .pop(), do not work in this scenario too. Any idea that what could be done to allow this attribution?The text was updated successfully, but these errors were encountered: