/** * @see net.sourceforge.htmlunit.corejs.javascript.Scriptable#setPrototype */ public void setPrototype(Scriptable prototype) { obj.setPrototype(prototype); } /**
private static void setIteratorPrototype(final Scriptable scriptable) { if (ITERATOR_PROTOTYPE_ == null) { ITERATOR_PROTOTYPE_ = new Iterator(ITERATOR_NAME, null); } scriptable.setPrototype(ITERATOR_PROTOTYPE_); }
private static void setIteratorPrototype(final Scriptable scriptable) { if (ITERATOR_PROTOTYPE_ == null) { ITERATOR_PROTOTYPE_ = new Iterator(ITERATOR_NAME, null); } scriptable.setPrototype(ITERATOR_PROTOTYPE_); }
private static void setIteratorPrototype(final Scriptable scriptable) { if (ITERATOR_PROTOTYPE_ == null) { ITERATOR_PROTOTYPE_ = new Iterator(MAP_ITERATOR_NAME, null); } scriptable.setPrototype(ITERATOR_PROTOTYPE_); }
private static void setIteratorPrototype(final Scriptable scriptable) { if (ITERATOR_PROTOTYPE_ == null) { ITERATOR_PROTOTYPE_ = new Iterator(SET_ITERATOR_NAME, null); } scriptable.setPrototype(ITERATOR_PROTOTYPE_); }
private static void setIteratorPrototype(final Scriptable scriptable) { if (ITERATOR_PROTOTYPE_ == null) { ITERATOR_PROTOTYPE_ = new com.gargoylesoftware.htmlunit.javascript.host.Iterator(ITERATOR_NAME, null); } scriptable.setPrototype(ITERATOR_PROTOTYPE_); }
private static void setIteratorPrototype(final Scriptable scriptable) { if (ITERATOR_PROTOTYPE_ == null) { ITERATOR_PROTOTYPE_ = new com.gargoylesoftware.htmlunit.javascript.host.Iterator(ITERATOR_NAME, null); } scriptable.setPrototype(ITERATOR_PROTOTYPE_); }
prototype.setPrototype(parentPrototype);
prototype.setPrototype(parentPrototype);
/** * Creates new script object. * The default implementation of {@link #construct} uses the method to * to get the value for <tt>thisObj</tt> argument when invoking * {@link #call}. * The methos is allowed to return <tt>null</tt> to indicate that * {@link #call} will create a new object itself. In this case * {@link #construct} will set scope and prototype on the result * {@link #call} unless they are already set. */ public Scriptable createObject(Context cx, Scriptable scope) { Scriptable newInstance = new NativeObject(); newInstance.setPrototype(getClassPrototype()); newInstance.setParentScope(getParentScope()); return newInstance; }
/** * Return new {@link Scriptable} instance using the default * constructor for the class of the underlying Java method. * Return null to indicate that the call method should be used to create * new objects. */ @Override public Scriptable createObject(Context cx, Scriptable scope) { if (member.isCtor() || parmsLength == VARARGS_CTOR) { return null; } Scriptable result; try { result = (Scriptable) member.getDeclaringClass().newInstance(); } catch (Exception ex) { throw Context.throwAsScriptRuntimeEx(ex); } result.setPrototype(getClassPrototype()); result.setParentScope(getParentScope()); return result; }
public Scriptable construct(Context cx, Scriptable scope, Object[] args) { Scriptable result = createObject(cx, scope); if (result != null) { Object val = call(cx, scope, result, args); if (val instanceof Scriptable) { result = (Scriptable)val; } } else { Object val = call(cx, scope, null, args); if (!(val instanceof Scriptable)) { // It is program error not to return Scriptable from // the call method if createObject returns null. throw new IllegalStateException( "Bad implementaion of call as constructor, name=" +getFunctionName()+" in "+getClass().getName()); } result = (Scriptable)val; if (result.getPrototype() == null) { result.setPrototype(getClassPrototype()); } if (result.getParentScope() == null) { Scriptable parent = getParentScope(); if (result != parent) { result.setParentScope(parent); } } } return result; }
/** * {@inheritDoc} */ @Override public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { final Object object = super.call(cx, scope, thisObj, args); if (object instanceof Scriptable) { final Scriptable result = (Scriptable) object; if (result.getPrototype() == null) { final Scriptable proto = getClassPrototype(); if (result != proto) { result.setPrototype(proto); } } if (result.getParentScope() == null) { final Scriptable parent = getParentScope(); if (result != parent) { result.setParentScope(parent); } } } return object; } }
/** * {@inheritDoc} */ @Override public Object call(final Context cx, final Scriptable scope, final Scriptable thisObj, final Object[] args) { final Object object = super.call(cx, scope, thisObj, args); if (object instanceof Scriptable) { final Scriptable result = (Scriptable) object; if (result.getPrototype() == null) { final Scriptable proto = getClassPrototype(); if (result != proto) { result.setPrototype(proto); } } if (result.getParentScope() == null) { final Scriptable parent = getParentScope(); if (result != parent) { result.setParentScope(parent); } } } return object; } }
newValue.setPrototype(getPrototype());
target.setPrototype(obj); } else { target.setParentScope(obj);
ScriptableObject.getObjectPrototype(window).setPrototype(fallbackCaller); prototype.setPrototype(parentPrototype); prototype.setPrototype(objectPrototype);
ScriptableObject.getObjectPrototype(window).setPrototype(fallbackCaller); prototype.setPrototype(parentPrototype); prototype.setPrototype(objectPrototype);
ScriptableObject.getObjectPrototype(window).setPrototype(fallbackCaller); prototype.setPrototype(parentPrototype); prototype.setPrototype(objectPrototype);
functionProto.setPrototype(objectProto);