Hi,
I have checked in the code to this branch "hari-change-array-by-copy" . However I get the below error when testing the method manually from the console. I don't see NativeArray invoked in the exception stack trace. What's going wrong in the code? Any ideas please
js> const items = [1, 2, 3];
js> items
1,2,3
js> items.toReversed()
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 70 out of bounds for length 70
at org.mozilla.javascript.IdScriptableObject$PrototypeValues.ensureId(IdScriptableObject.java:284)
at org.mozilla.javascript.IdScriptableObject$PrototypeValues.get(IdScriptableObject.java:162)
at org.mozilla.javascript.IdScriptableObject.get(IdScriptableObject.java:380)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:2037)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2584)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2575)
at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:71)
at org.mozilla.javascript.gen._stdin__3._c_script_0(<stdin>:4)
at org.mozilla.javascript.gen._stdin__3.call(<stdin>)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:383)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3876)
at org.mozilla.javascript.gen._stdin__3.call(<stdin>)
at org.mozilla.javascript.gen._stdin__3.exec(<stdin>)
at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:482)
at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:180)
at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:98)
at org.mozilla.javascript.Context.call(Context.java:544)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:475)
at org.mozilla.javascript.tools.shell.Main.exec(Main.java:164)
at org.mozilla.javascript.tools.shell.Main.main(Main.java:142)