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

x33g5p2x  于2022-01-30 转载在 JavaScript  
字(4.3k)|赞(0)|评价(0)|浏览(125)

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

ScriptableObject.avoidObjectDetection介绍

[英]Emulate the SpiderMonkey (and Firefox) feature of allowing custom objects to avoid detection by normal "object detection" code patterns. This is used to implement document.all. See https://bugzilla.mozilla.org/show_bug.cgi?id=412247. This is an analog to JOF_DETECTING from SpiderMonkey; see https://bugzilla.mozilla.org/show_bug.cgi?id=248549. Other than this special case, embeddings should return false.
[中]模拟SpiderMonkey(和Firefox)的特性,允许自定义对象避免被正常的“对象检测”代码模式检测到。这是用来实现文档的。全部的看见https://bugzilla.mozilla.org/show_bug.cgi?id=412247.这是从SpiderMonkey检测JOF_的一个模拟;看见https://bugzilla.mozilla.org/show_bug.cgi?id=248549.除了这种特殊情况,嵌入应该返回false。

代码示例

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

/**
 * Gets the value that will be returned by calling the typeof operator on this object.
 * @return default is "object" unless {@link #avoidObjectDetection()} is <code>true</code> in which
 * case it returns "undefined"
 */
public String getTypeOf() {
  return avoidObjectDetection() ? "undefined" : "object";
}

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

/**
 * Gets the value that will be returned by calling the typeof operator on this object.
 * @return default is "object" unless {@link #avoidObjectDetection()} is <code>true</code> in which
 * case it returns "undefined"
 */
public String getTypeOf() {
  return avoidObjectDetection() ? "undefined" : "object";
}

代码示例来源:origin: io.apigee/rhino

/**
 * Gets the value that will be returned by calling the typeof operator on this object.
 * @return default is "object" unless {@link #avoidObjectDetection()} is <code>true</code> in which
 * case it returns "undefined"
 */
public String getTypeOf() {
  return avoidObjectDetection() ? "undefined" : "object";
}

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

/**
 * Gets the value that will be returned by calling the typeof operator on this object.
 * @return default is "object" unless {@link #avoidObjectDetection()} is <code>true</code> in which
 * case it returns "undefined"
 */
public String getTypeOf() {
  return avoidObjectDetection() ? "undefined" : "object";
}

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

/**
 * The typeof operator
 */
public static String typeof(Object value)
{
  if (value == null)
    return "object";
  if (value == Undefined.instance)
    return "undefined";
  if (value instanceof Scriptable)
  {
    if (value instanceof ScriptableObject &&
      ((ScriptableObject)value).avoidObjectDetection())
    {
      return "undefined";
    }
    if (value instanceof XMLObject)
      return "xml";
    return (value instanceof Callable) ? "function" : "object";
  }
  if (value instanceof String)
    return "string";
  if (value instanceof Number)
    return "number";
  if (value instanceof Boolean)
    return "boolean";
  throw errorWithClassName("msg.invalid.type", value);
}

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

((ScriptableObject) val).avoidObjectDetection())

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

((ScriptableObject) val).avoidObjectDetection())

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

((ScriptableObject) val).avoidObjectDetection())

代码示例来源:origin: io.apigee/rhino

((ScriptableObject) val).avoidObjectDetection())

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

((ScriptableObject) val).avoidObjectDetection())

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

} else {
  b = args[0] instanceof ScriptableObject &&
      ((ScriptableObject) args[0]).avoidObjectDetection()
    ? true
    : ScriptRuntime.toBoolean(args[0]);

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

} else {
  b = args[0] instanceof ScriptableObject &&
      ((ScriptableObject) args[0]).avoidObjectDetection()
    ? true
    : ScriptRuntime.toBoolean(args[0]);

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

} else {
  b = args[0] instanceof ScriptableObject &&
      ((ScriptableObject) args[0]).avoidObjectDetection()
    ? true
    : ScriptRuntime.toBoolean(args[0]);

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

} else {
  b = args[0] instanceof ScriptableObject &&
      ((ScriptableObject) args[0]).avoidObjectDetection()
    ? true
    : ScriptRuntime.toBoolean(args[0]);

代码示例来源:origin: io.apigee/rhino

} else {
  b = args[0] instanceof ScriptableObject &&
      ((ScriptableObject) args[0]).avoidObjectDetection()
    ? true
    : ScriptRuntime.toBoolean(args[0]);

相关文章

微信公众号

ScriptableObject类方法