Better handle creation of the Object[] array for passing to javascript method implementations.