<div dir="ltr">Hello all,<div><br></div><div>  I&#39;m currently using GraalJS to execute some javascript functions from my Java code. One of this javascript functions receives an array as an argument and invokes the <i>sort()</i> method.</div><div><br></div><div>  To invoke this function from Java, I&#39;m creating an ArrayList and I send it to through a ProxyArray, something similar to this code snippet:</div><div><br></div><div><i>      Source sources = Source.newBuilder(&quot;js&quot;, jsCode, &quot;myCode&quot;).buildLiteral();</i></div><div><i>      Source function = Source.create(&quot;js&quot;, &quot;myFunction&quot;);<br></i></div><div><i>      List&lt;String&gt; myList = new ArrayList&lt;&gt;();</i></div><div><i>      try (Context context = Context.newBuilder()</i></div><i>        .engine(Engine.create())<br>        .allowHostAccess(HostAccess.ALL)<br>        .build()) {<br>          context.eval(sources);<br>          Value res = context.eval(function).execute(ProxyArray.fromList(myList));<br>    }</i><div><br></div><div>  That code fails with the following error: &quot;<i>org.graalvm.polyglot.PolyglotException: TypeError: invokeMember on foreign object failed due to: Message not supported.</i>&quot;</div><div><br></div><div>  To make it work, I need to enable the <i>js.experimental-foreign-object-prototype </i>option[1] for the Context.</div><div><br></div><div>  Being an experimental option and according to the docs, it is not recommended to enable it for productive environments. My questions are:</div><div><br></div><div>  a) ¿Is there any plan to switch this option as non-experimental?</div><div>  b) ¿Do you know if there exists any alternative (or a better way) to provide a JS array as an argument of a JS function from Java?</div><div><br></div><div>Thank you in advance.</div><div><br></div><div>[1] <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_graalvm_graaljs_issues_88-23issuecomment-2D453021299&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=SONxRA-cJWH4INLX-uDgL1Afx7XABorqPK3ite36VtA&s=Hw4Fpfxv8qQMK9XrdAcEW49J5nMi0ODhnsFdecPww3U&e=">https://github.com/graalvm/graaljs/issues/88#issuecomment-453021299</a><br><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div style="color:rgb(0,0,0);font-family:&quot;Times New Roman&quot;;font-size:medium;float:left;margin-right:15px"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openbravo.com&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=SONxRA-cJWH4INLX-uDgL1Afx7XABorqPK3ite36VtA&s=qLyjnBLTJ0nP65gCeCPRY2IqJC0l9sOfxepjQ0AnXfM&e=" target="_blank"><img src="https://www.openbravo.com/wp-content/uploads/2018/08/logoOB_OBI.png" width="170px;" height="38px;"></a></div><div><span style="color:rgb(102,102,102);font-family:&quot;Century Gothic&quot;,Verdana;font-size:12px;font-weight:bold">Carlos Aristu López</span><font color="#000000" face="Times New Roman" size="3"> </font><br><font color="#6eb43f" face="Century Gothic, Verdana"><span style="font-size:12px">Applications Engineer</span></font><br><br></div><p style="font-size:11px;font-family:&quot;Century Gothic&quot;,Verdana;color:rgb(153,153,153)"><i>This e-mail is confidential and contains private information. Any reading, retention, distribution or copying of this communication by any person other than its intended recipient is prohibited.</i></p><p style="font-size:11px;font-family:&quot;Century Gothic&quot;,Verdana;color:rgb(153,153,153)"><i>Your data is processed by Openbravo under our <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openbravo.com_privacy-2Dpolicy_&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=SONxRA-cJWH4INLX-uDgL1Afx7XABorqPK3ite36VtA&s=S2N4L5FShXFXrm0d1AT3OyWLXYYH51PCWsdofw_twng&e=" style="color:rgb(110,180,63)" target="_blank">privacy policy</a></i></p></div></div></div></div></div></div></div></div>