org.mozilla.javascript.Function.getParentScope()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 JavaScript  
字(4.9k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.mozilla.javascript.Function.getParentScope()方法的一些代码示例,展示了Function.getParentScope()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function.getParentScope()方法的具体详情如下:
包路径:org.mozilla.javascript.Function
类名称:Function
方法名:getParentScope

Function.getParentScope介绍

暂无

代码示例

代码示例来源:origin: org.apache.xmlgraphics/batik-bridge

public Scriptable getParentScope() {
  return this.delegate.getParentScope();
}

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public Scriptable getParentScope() {
  return this.delegate.getParentScope();
}

代码示例来源:origin: apache/batik

public Scriptable getParentScope() {
  return this.delegate.getParentScope();
}

代码示例来源:origin: com.github.tntim96/rhino

private static Global getInstance(Function function)
{
  Scriptable scope = function.getParentScope();
  if (!(scope instanceof Global))
    throw reportRuntimeError("msg.bad.shell.function.scope",
                 String.valueOf(scope));
  return (Global)scope;
}

代码示例来源:origin: ro.isdc.wro4j/rhino

private static Global getInstance(Function function)
{
  Scriptable scope = function.getParentScope();
  if (!(scope instanceof Global))
    throw reportRuntimeError("msg.bad.shell.function.scope",
                 String.valueOf(scope));
  return (Global)scope;
}

代码示例来源:origin: apache/batik

public Object run(Context cx) {
    Object[] args = ab.buildArguments();
    handler.call(cx, handler.getParentScope(), globalObject, args);
    return null;
  }
});

代码示例来源:origin: org.apache.xmlgraphics/batik-bridge

public Object run(Context cx) {
    Object[] args = ab.buildArguments();
    handler.call(cx, handler.getParentScope(), globalObject, args);
    return null;
  }
});

代码示例来源:origin: fr.avianey.apache-xmlgraphics/batik

public Object run(Context cx) {
    Object[] args = ab.buildArguments();
    handler.call(cx, handler.getParentScope(), globalObject, args);
    return null;
  }
});

代码示例来源:origin: cat.inspiracio/rhino-js-engine

private Object call(Function func, Object[] args) {
  Context cx = Context.getCurrentContext();
  Scriptable thisObj = getAdaptee();
  Scriptable scope = func.getParentScope();
  try {
    return func.call(cx, scope, thisObj, args);
  } catch (RhinoException re) {
    throw Context.reportRuntimeError(re.getMessage());
  }
}

代码示例来源:origin: io.apisense/rhino-android

private Object call(Function func, Object[] args) {
  Context cx = Context.getCurrentContext();
  Scriptable thisObj = getAdaptee();
  Scriptable scope = func.getParentScope();
  try {
    return func.call(cx, scope, thisObj, args);
  } catch (RhinoException re) {
    throw Context.reportRuntimeError(re.getMessage());
  }
}

代码示例来源:origin: org.bsc/jvm-npm-rhino

@Override
public Object invokeMethod(Object thiz, final String name, final Object... args)
    throws ScriptException, NoSuchMethodException {
  if (thiz == null) {
    throw new java.lang.IllegalArgumentException("thiz is null!");
  }
  if (name == null) {
    throw new java.lang.IllegalArgumentException("method name is null");
  }
  if (!(thiz instanceof Scriptable)) {
    thiz = Context.toObject(thiz, topLevel);
  }
  final Scriptable localScope = (Scriptable) thiz;
  final Object obj = ScriptableObject.getProperty(localScope, name);
  if (!(obj instanceof org.mozilla.javascript.Function)) {
    throw new NoSuchMethodException("no such method: " + name);
  }
  return callInContext((cx) -> {
    final org.mozilla.javascript.Function func = (org.mozilla.javascript.Function) obj;
    Scriptable parentScope = func.getParentScope();
    if (parentScope == null) {
      parentScope = topLevelProto();
    }
    Object result = func.call(cx, parentScope, localScope, wrapArguments(args));
    return unwrapReturnValue(result);
  });
}

代码示例来源:origin: com.google.code.scriptengines/scriptengines-javascript

private Object call(Function func, Object[] args) {
  Context cx = Context.getCurrentContext();
  Scriptable thisObj = getAdaptee();
  Scriptable scope = func.getParentScope();
  try {
    return func.call(cx, scope, thisObj, args);
  } catch (RhinoException re) {
    throw Context.reportRuntimeError(re.getMessage());
  }
}

代码示例来源:origin: rhq-project/rhq

private Object call(Function func, Object[] args) {
  Context cx = Context.getCurrentContext();
  Scriptable thisObj = getAdaptee();
  Scriptable scope = func.getParentScope();
  try {
    return func.call(cx, scope, thisObj, args);
  } catch (RhinoException re) {
    throw Context.reportRuntimeError(re.getMessage());
  }
}

代码示例来源:origin: org.bsc/jvm-npm-rhino

Scriptable parentScope = func.getParentScope();
if (parentScope == null) {
  parentScope = topLevelProto();

代码示例来源:origin: org.geoserver.script/gs-script-js

Scriptable scope = method.getParentScope();
if (scope == null) {
  scope = getGlobal();

代码示例来源:origin: rhino/js

final Scriptable scope = f.getParentScope();
if (argsToWrap == 0) {
  return Context.call(factory, f, scope, thisObj, args);

代码示例来源:origin: geogebra/geogebra

final Scriptable scope = f.getParentScope();
if (argsToWrap == 0) {
  return Context.call(factory, f, scope, thisObj, args);

代码示例来源:origin: geogebra/geogebra

Function f = (Function)getter;
Context cx = Context.getContext();
return f.call(cx, f.getParentScope(), start,
       ScriptRuntime.emptyArgs);

代码示例来源:origin: ro.isdc.wro4j/rhino

final Scriptable scope = f.getParentScope();
if (argsToWrap == 0) {
  return Context.call(factory, f, scope, thisObj, args);

代码示例来源:origin: ro.isdc.wro4j/rhino

Function f = (Function)getter;
Context cx = Context.getContext();
return f.call(cx, f.getParentScope(), start,
       ScriptRuntime.emptyArgs);

相关文章