Package org.mozilla.javascript

Examples of org.mozilla.javascript.Context.newArray()


          // Add compress if the value is set for backward compatibility
          if (this.compress != null && this.compress.booleanValue()) {
            options.add("-x");
          }
         
            Scriptable argsObj = cx.newArray(compileScope, options.toArray(new Object[options.size()]));
            //Scriptable argsObj = cx.newArray(compileScope, new Object[] {"-ru", "c.less"});
            compileScope.defineProperty("arguments", argsObj, ScriptableObject.DONTENUM);
           
            // invoke the compiler - we don't pass arguments here because its a script not a real function
            // and we don't care about the result because its written to the output stream (out)
View Full Code Here


            } else {
                int length = args.length - 1;
                array = new Object[length];
                System.arraycopy(args, 1, array, 0, length);
            }
            Scriptable argsObj = cx.newArray(BasicRhinoShell, array);
            BasicRhinoShell.defineProperty("arguments", argsObj, ScriptableObject.DONTENUM);

            BasicRhinoShell.processSource(cx, args.length == 0 ? null : args[0]);
        } finally {
            Context.exit();
View Full Code Here

        if (bodyObj instanceof String) {
            // be lenient and convert strings to arrays
            Object[] array = {(String) bodyObj};
            Context cx = CommonJSEngine.enterContext();
            try {
                bodyObj = cx.newArray(scope, array);
            } finally {
                Context.exit();
            }
        }
        if (bodyObj instanceof Scriptable) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.