Package org.mozilla.javascript

Examples of org.mozilla.javascript.Script.exec()


        throws Exception {
        org.mozilla.javascript.Context cx =
            org.mozilla.javascript.Context.getCurrentContext();
        Scriptable scope = getParentScope();
        Script script = interpreter.compileScript( cx, filename );
        return script.exec( cx, scope );
    }   
       
    public static class FOM_Request extends ScriptableObject {

        Request request;
View Full Code Here


        throws Exception {
        org.mozilla.javascript.Context cx =
            org.mozilla.javascript.Context.getCurrentContext();
        Scriptable scope = getParentScope();
        Script script = getInterpreter().compileScript(cx, filename);
        return script.exec( cx, scope );
    }

    /**
     * Setup an object so that it can access the information provided to regular components.
     * This is done by calling the various Avalon lifecycle interfaces implemented by the object, which
View Full Code Here

                if (reloadScripts && lastExecTime != 0) {
                    lastMod = entry.getSource().getLastModified();
                }
                Script script = entry.getScript(context, this.scope, false, this);
                if (lastExecTime == 0 || lastMod > lastExecTime) {
                    script.exec(context, thrScope);
                    thrScope.onExec();
                }
            }
        }
    }
View Full Code Here

                // just update it's index so it won't get deleted soon.
                compiledScripts.addLast(et);
            }

            try {
                rv = script.exec(ctx, globalObject);
            } catch (JavaScriptException e) {
                // exception from JavaScript (possibly wrapping a Java Ex)
                if (e.getValue() instanceof Exception) {
                    Exception ex = (Exception)e.getValue();
                    throw new InterpreterException(ex, ex.getMessage(), -1,-1);
View Full Code Here

        throws Exception {
        org.mozilla.javascript.Context cx =
            org.mozilla.javascript.Context.getCurrentContext();
        Scriptable scope = getParentScope();
        Script script = getInterpreter().compileScript(cx, filename);
        return script.exec( cx, scope );
    }

    /**
     * Setup an object so that it can access the information provided to regular components.
     * This is done by calling the various Avalon lifecycle interfaces implemented by the object, which
View Full Code Here

                ScriptSourceEntry entry =
                    (ScriptSourceEntry) compiledScripts.get(sourceURI);
                long lastMod = entry.getSource().getLastModified();
                Script script = entry.getScript(context, this.scope, false, this);
                if (lastExecTime == 0 || lastMod > lastExecTime) {
                    script.exec(context, thrScope);
                    thrScope.onExec();
                }
            }
        }
    }
View Full Code Here

  }
   
  public Scriptable compileReader(Reader r, String path, Context cx, Scriptable scriptScope) throws IOException {
    cx.setLanguageVersion(Context.VERSION_1_7);
    final Script script = cx.compileReader(r, path, 1, null);     
    script.exec(cx, scriptScope);
    return scriptScope;
  }
 
  public Scriptable newScope(Context cx) {
    final Scriptable scope = cx.newObject(parentScope);
View Full Code Here

            //TODO: only need this for the load function, maybe there is a built in way
            //to get this.
            ScriptableObject.putProperty(topScope, "global", Context.javaToJS(topScope, topScope));

            // Exec the build script.
            script.exec(context, topScope);

            // Call build.make(builderPath)
            Scriptable build = Context.toObject(topScope.get("build", topScope), topScope);
            Object args[] = {
                    builderPath,
View Full Code Here

            org.mozilla.javascript.Context.getCurrentContext();
        Scriptable scope = getParentScope();
        Script script = interpreter.compileScript( cx,
                                                   environment,
                                                   filename );
        return script.exec( cx, scope );
    }   
       
    public static class FOM_Request extends ScriptableObject {

        Request request;
View Full Code Here

                ScriptSourceEntry entry =
                    (ScriptSourceEntry)compiledScripts.get(sourceURI);
                long lastMod = entry.getSource().getLastModified();
                Script script = entry.getScript(context, this.scope, false);
                if (lastExecTime == 0 || lastMod > lastExecTime) {
                    script.exec(context, thrScope);
                }
            }
        }
        return thrScope;
    }
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.