void runUserScript( Context c ) { Main.processSource(c, sourceFile.getAbsolutePath()); }
void runInitScripts(Context c, Scriptable scope) { Main.processSource(c, new File(baseDir, "standard/generalJs/env.rhino.1.2.js").getAbsolutePath()); Main.processSource(c, new File( baseDir, "standard/generalJs/Util.js" ).getAbsolutePath() ); // gzip util c.evaluateString(scope, "window.location='file://" + baseDir.getAbsolutePath() + "/';", this .getClass().getName(), 1, null); Main.processSource(c, new File(baseDir, "standard/generalJs/buildTimeReportSupport.js") .getAbsolutePath()); }
static void processFiles(Context cx, String[] args) { // define "arguments" array in the top-level object: // need to allocate new array since newArray requires instances // of exactly Object[], not ObjectSubclass[] Object[] array = new Object[args.length]; System.arraycopy(args, 0, array, 0, args.length); Scriptable argsObj = cx.newArray(global, array); global.defineProperty("arguments", argsObj, ScriptableObject.DONTENUM); for (String file: fileList) { processSource(cx, file); } }
processSource(cx, file); } catch (IOException ioex) { Context.reportError(ToolErrorReporter.getMessage(
processSource(cx, file); } catch (IOException ioex) { Context.reportError(ToolErrorReporter.getMessage(