Examples of Scriptable


Examples of org.mozilla.javascript.Scriptable

  public Object runScript(String scope,String script,String scriptName) throws JavascriptException {
    try{
      Context.enter();
      JsContext context = getScope(scope);
      context.startTime = System.currentTimeMillis();
      Scriptable scriptable = context.scriptable;
     
      try {
        Object result = context.evaluateString(scriptable, script, scriptName, 0, null);
        return result;
      } catch (EcmaError error) {
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

    }
    return keys;
  }

  public String getObjectKey(Object object) {
    Scriptable scriptable = scopes.get(GLOBAL).scriptable;
    String[] keys = getObjects();
    for(String key: keys) {
      if(scriptable.get(key, scriptable)==object) {
        return key;
      }
    }
    return null;
  }
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

    }
    return null;
  }

  public Object getObject(String name) {
    Scriptable scriptable = scopes.get(GLOBAL).scriptable;
    return scriptable.get(name, scriptable);
  }
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

    public void close() {
        Context.exit();
    }

    public void openScope() {
        Scriptable newScope = context.newObject(scope);
        newScope.setParentScope(scope);
        scope = newScope;
        ++scopeLevel;
    }
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

            public Object invoke(Object thisArg, Object[] args)
                throws Exception {
                org.mozilla.javascript.Context cx = org.mozilla.javascript.Context.enter();
                try {
                    Object result;
                    Scriptable thisObj;
                    if (!(thisArg instanceof Scriptable)) {
                        thisObj = org.mozilla.javascript.Context.toObject(thisArg, scope);
                    } else {
                        thisObj = (Scriptable)thisArg;
                    }
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

            }
           
            public Object invoke(Object thisArg) throws Exception {
                org.mozilla.javascript.Context.enter();
                try {
                    Scriptable thisObj;
                    if (!(thisArg instanceof Scriptable)) {
                        thisObj = org.mozilla.javascript.Context.toObject(thisArg, scope);
                    } else {
                        thisObj = (Scriptable)thisArg;
                    }
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

            }
           
            public Object invoke(Object thisArg, Object rhs) throws Exception {
                org.mozilla.javascript.Context.enter();
                try {
                    Scriptable thisObj;
                    Object arg = rhs;
                    if (!(thisArg instanceof Scriptable)) {
                        thisObj = org.mozilla.javascript.Context.toObject(thisArg, scope);
                    } else {
                        thisObj = (Scriptable)thisArg;
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

        Context.setCachingEnabled(true)// enable caching again
        // entering a context
        Context ctx = enterContext();
        try {
            try {
                Scriptable scriptable = ctx.initStandardObjects(null, false);
                ScriptableObject.defineClass(scriptable, WindowWrapper.class);
            } catch (Exception e) {
                // cannot happen
            }
            // we now have the window object as the global object from the
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

        try {
            if (name.equals(BIND_NAME_WINDOW) && object instanceof Window) {
                ((WindowWrapper)globalObject).window = (Window)object;
            } else {
                Scriptable jsObject =  Context.toObject(object, globalObject);
                globalObject.put(name, globalObject, jsObject);
            }

        } finally {
            Context.exit();
View Full Code Here

Examples of org.mozilla.javascript.Scriptable

    public void bindObject(String name, Object object) {
        Context ctx = enterContext();

        ctx.setWrapHandler(wrapHandler);
        try {
            Scriptable jsObject =  Context.toObject(object, globalObject);
            globalObject.put(name, globalObject, jsObject);
        } finally {
            Context.exit();
        }
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.