/** * Implements the instanceof operator. * * <p>This operator has been proposed to ECMA. * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if "this" appears in value's prototype chain * */ public boolean hasInstance(Scriptable instance) { // Default for JS objects (other than Function) is to do prototype // chasing. This will be overridden in NativeFunction and non-JS // objects. return ScriptRuntime.jsDelegatesTo(instance, this); }
/** * Implements the instanceof operator. * * <p>This operator has been proposed to ECMA. * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if "this" appears in value's prototype chain * */ public boolean hasInstance(Scriptable instance) { // Default for JS objects (other than Function) is to do prototype // chasing. This will be overridden in NativeFunction and non-JS // objects. return ScriptRuntime.jsDelegatesTo(instance, this); }
/** * Implements the instanceof operator. * * <p>This operator has been proposed to ECMA. * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if "this" appears in value's prototype chain * */ public boolean hasInstance(Scriptable instance) { // Default for JS objects (other than Function) is to do prototype // chasing. This will be overridden in NativeFunction and non-JS // objects. return ScriptRuntime.jsDelegatesTo(instance, this); }
/** * Implements the instanceof operator. * * <p>This operator has been proposed to ECMA. * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if "this" appears in value's prototype chain * */ public boolean hasInstance(Scriptable instance) { // Default for JS objects (other than Function) is to do prototype // chasing. This will be overridden in NativeFunction and non-JS // objects. return ScriptRuntime.jsDelegatesTo(instance, this); }
/** * Implements the instanceof operator. * * <p>This operator has been proposed to ECMA. * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if "this" appears in value's prototype chain * */ public boolean hasInstance(Scriptable instance) { // Default for JS objects (other than Function) is to do prototype // chasing. This will be overridden in NativeFunction and non-JS // objects. return ScriptRuntime.jsDelegatesTo(instance, this); }
/** * Implements the instanceof operator. * * <p>This operator has been proposed to ECMA. * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if "this" appears in value's prototype chain * */ public boolean hasInstance(Scriptable instance) { // Default for JS objects (other than Function) is to do prototype // chasing. This will be overridden in NativeFunction and non-JS // objects. return ScriptRuntime.jsDelegatesTo(instance, this); }
/** * Implements the instanceof operator for JavaScript Function objects. * <p> * <code> * foo = new Foo();<br> * foo instanceof Foo; // true<br> * </code> * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if the "prototype" property of "this" appears in * value's prototype chain * */ @Override public boolean hasInstance(Scriptable instance) { Object protoProp = ScriptableObject.getProperty(this, "prototype"); if (protoProp instanceof Scriptable) { return ScriptRuntime.jsDelegatesTo(instance, (Scriptable)protoProp); } throw ScriptRuntime.typeError1("msg.instanceof.bad.prototype", getFunctionName()); }
/** * Implements the instanceof operator for JavaScript Function objects. * <p> * <code> * foo = new Foo();<br> * foo instanceof Foo; // true<br> * </code> * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if the "prototype" property of "this" appears in * value's prototype chain * */ @Override public boolean hasInstance(Scriptable instance) { Object protoProp = ScriptableObject.getProperty(this, "prototype"); if (protoProp instanceof Scriptable) { return ScriptRuntime.jsDelegatesTo(instance, (Scriptable)protoProp); } throw ScriptRuntime.typeError1("msg.instanceof.bad.prototype", getFunctionName()); }
/** * Implements the instanceof operator for JavaScript Function objects. * <p> * <code> * foo = new Foo();<br> * foo instanceof Foo; // true<br> * </code> * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if the "prototype" property of "this" appears in * value's prototype chain * */ public boolean hasInstance(Scriptable instance) { Object protoProp = ScriptableObject.getProperty(this, "prototype"); if (protoProp instanceof Scriptable) { return ScriptRuntime.jsDelegatesTo(instance, (Scriptable)protoProp); } throw ScriptRuntime.typeError1("msg.instanceof.bad.prototype", getFunctionName()); }
/** * Implements the instanceof operator for JavaScript Function objects. * <p> * <code> * foo = new Foo();<br> * foo instanceof Foo; // true<br> * </code> * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if the "prototype" property of "this" appears in * value's prototype chain * */ @Override public boolean hasInstance(Scriptable instance) { Object protoProp = ScriptableObject.getProperty(this, "prototype"); if (protoProp instanceof Scriptable) { return ScriptRuntime.jsDelegatesTo(instance, (Scriptable)protoProp); } throw ScriptRuntime.typeError1("msg.instanceof.bad.prototype", getFunctionName()); }
/** * Implements the instanceof operator for JavaScript Function objects. * <p> * <code> * foo = new Foo();<br> * foo instanceof Foo; // true<br> * </code> * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if the "prototype" property of "this" appears in * value's prototype chain * */ @Override public boolean hasInstance(Scriptable instance) { Object protoProp = ScriptableObject.getProperty(this, "prototype"); if (protoProp instanceof Scriptable) { return ScriptRuntime.jsDelegatesTo(instance, (Scriptable)protoProp); } throw ScriptRuntime.typeError1("msg.instanceof.bad.prototype", getFunctionName()); }
/** * Implements the instanceof operator for JavaScript Function objects. * <p> * <code> * foo = new Foo();<br> * foo instanceof Foo; // true<br> * </code> * * @param instance The value that appeared on the LHS of the instanceof * operator * @return true if the "prototype" property of "this" appears in * value's prototype chain * */ @Override public boolean hasInstance(Scriptable instance) { Object protoProp = ScriptableObject.getProperty(this, "prototype"); if (protoProp instanceof Scriptable) { return ScriptRuntime.jsDelegatesTo(instance, (Scriptable)protoProp); } throw ScriptRuntime.typeError1("msg.instanceof.bad.prototype", getFunctionName()); }