Functions defined at JS level and functions defined as an AbstractJSObject are passed arguments differently when invoked through Function.prototype.apply.call(): the AbstractJSObject implementation will be passed an Object[] containing an Object[] holding all the arguments, whereas the JS function will be passed an array containing the arguments (not nested in an extra array).
The attached test case produces the following output:
args = [1, 2, 3]
args = [[1, 2, 3]] // note this line
1
2
3
1
2
3
Expected:
args = [1, 2, 3]
args = [1, 2, 3] // this differs from above
1
2
3
1
2
3