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

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

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

Function.get介绍

暂无

代码示例

代码示例来源:origin: com.googlecode.jslint4java/jslint4java

/**
 * Return the version of jslint in use.
 */
public String getEdition() {
  return (String) lintFunc.get("edition", lintFunc);
}

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

public Object get(int index, Scriptable start) {
  return this.delegate.get(index, start);
}

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

public Object get(String name, Scriptable start) {
  return this.delegate.get(name, start);
}

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

public Object get(String name, Scriptable start) {
  return this.delegate.get(name, start);
}

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

public Object get(int index, Scriptable start) {
  return this.delegate.get(index, start);
}

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

public Object get(String name, Scriptable start) {
  return this.delegate.get(name, start);
}

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

public Object get(int index, Scriptable start) {
  return this.delegate.get(index, start);
}

代码示例来源:origin: com.googlecode.jslint4java/jslint4java

value = lintFunc.get("data", lintFunc);
if (value == UniqueTag.NOT_FOUND) {
  return "";
value = lintFunc.get("error_report", lintFunc);
  value = lintFunc.get("report", lintFunc);

代码示例来源:origin: com.googlecode.jslint4java/jslint4java

private List<Issue> readErrors(String systemId) {
  ArrayList<Issue> issues = new ArrayList<Issue>();
  Scriptable errors = (Scriptable) lintFunc.get("errors", lintFunc);
  int count = Util.intValue("length", errors);
  for (int i = 0; i < count; i++) {
    Scriptable err = (Scriptable) errors.get(i, errors);
    // JSLINT spits out a null when it cannot proceed.
    // TODO Should probably turn i-1th issue into a "fatal".
    if (err != null) {
      issues.add(IssueBuilder.fromJavaScript(systemId, err));
    }
  }
  return issues;
}

代码示例来源:origin: pl.touk/jshint4j

private List<Error> lint(Context cx, Scriptable scope, String source, String options) {
  List<Error> errors = new ArrayList<Error>();
  Function jsHintFunction = (Function) scope.get("JSHINT", scope);
  Object jsHintOptions = options == null ? null : cx.evaluateString(scope, "options = " + options, null, 1, null);
  jsHintFunction.call(cx, scope, scope, new Object[] { source, jsHintOptions });
  @SuppressWarnings("unchecked")
  List<Map<String, ?>> jsErrors = (List<Map<String, ?>>) jsHintFunction.get("errors", jsHintFunction);
  for (Map<String, ?> jsError : jsErrors) {
    if (jsError != null) {
      errors.add(toError(jsError));
    }
  }
  return errors;
}

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

private static void js_captureStackTrace(Context cx, Scriptable thisObj, Object[] args)
{
  ScriptableObject obj = (ScriptableObject)ScriptRuntime.toObjectOrNull(cx, args[0], thisObj);
  Function func = null;
  if (args.length > 1) {
    func = (Function)ScriptRuntime.toObjectOrNull(cx, args[1], thisObj);
  }
  // Create a new error that will have the correct prototype so we can re-use "getStackTrace"
  NativeError err = (NativeError)cx.newObject(thisObj, "Error");
  // Wire it up so that it will have an actual exception with a stack trace
  err.setStackProvider(new EvaluatorException("[object Object]"));
  // Figure out if they passed a function used to hide part of the stack
  if (func != null) {
    Object funcName = func.get("name", func);
    if ((funcName != null) && !Undefined.instance.equals(funcName)) {
      err.associateValue(STACK_HIDE_KEY, Context.toString(funcName));
    }
  }
  // Define a property on the specified object to get that stack
  // that delegates to our new error. Build the stack trace lazily
  // using the "getStack" code from NativeError.
  obj.defineProperty("stack", err,
            ERROR_DELEGATE_GET_STACK, ERROR_DELEGATE_SET_STACK, 0);
}

代码示例来源:origin: com.googlecode.jslint4java/jslint4java

Object o = lintFunc.get("data", lintFunc);
Object properties = lintFunc.get("property", lintFunc);
if (properties != UniqueTag.NOT_FOUND) {
  for (Object id: ScriptableObject.getPropertyIds((Scriptable) properties)) {

相关文章