what are the methods to pass a function as a constructor function to script environment other than using jdk.nashorn.api.scripting.JSObject.(JSObject newObject method)