public static void load(Context cx, Scriptable thisObj,
                            Object[] args, Function funObj)
    {
        for (Object arg : args) {
            String file = Context.toString(arg);
            try {
                Main.processFile(cx, thisObj, file);
            } catch (IOException ioex) {
                String msg = ToolErrorReporter.getMessage(
                        "msg.couldnt.read.source", file, ioex.getMessage());
                throw Context.reportRuntimeError(msg);
            } catch (VirtualMachineError ex) {
                // Treat StackOverflow and OutOfMemory as runtime errors
                ex.printStackTrace();
                String msg = ToolErrorReporter.getMessage(
                        "msg.uncaughtJSException", ex.toString());
                throw Context.reportRuntimeError(msg);
            }
        }
    }
public static void load ( Context cx , Scriptable thisObj , Object [ ] args , Function funObj ) { for ( Object arg : args ) { String file = Context . toString ( arg ) ; try { Main . processFile ( cx , thisObj , file ) ; } catch ( IOException ioex ) { String msg = ToolErrorReporter . getMessage ( "msg.couldnt.read.source" , file , ioex . getMessage ( ) ) ; throw Context . reportRuntimeError ( msg ) ; } catch ( VirtualMachineError ex ) { ex . printStackTrace ( ) ; String msg = ToolErrorReporter . getMessage ( "msg.uncaughtJSException" , ex . toString ( ) ) ; throw Context . reportRuntimeError ( msg ) ; } } }
Load and execute a set of JavaScript source files.

This method is defined as a JavaScript function.