/** * {@inheritDoc} */ @Override public Scriptable construct(final Context cx, final Scriptable scope, final Object[] args) { return wrapped_.construct(cx, scope, args); }
/** * {@inheritDoc} */ @Override public Scriptable construct(final Context cx, final Scriptable scope, final Object[] args) { return wrapped_.construct(cx, scope, args); }
/** * Operator new. * * See ECMA 11.2.2 */ public static Scriptable newObject(Object fun, Context cx, Scriptable scope, Object[] args) { if (!(fun instanceof Function)) { throw notFunctionError(fun); } Function function = (Function)fun; return function.construct(cx, scope, args); }
public static Scriptable newObject(Context cx, Scriptable scope, String constructorName, Object[] args) { scope = ScriptableObject.getTopLevelScope(scope); Function ctor = getExistingCtor(cx, scope, constructorName); if (args == null) { args = ScriptRuntime.emptyArgs; } return ctor.construct(cx, scope, args); }
/** * {@inheritDoc} */ public final Scriptable construct(final Context cx, final Scriptable scope, final Object[] args) { final SimpleScriptable wrapped = getWrappedScriptable(); if (wrapped instanceof Function) { return ((Function) wrapped).construct(cx, scope, args); } throw Context.reportRuntimeError(wrapped + " is not a function."); }
/** * {@inheritDoc} */ public final Scriptable construct(final Context cx, final Scriptable scope, final Object[] args) { final SimpleScriptable wrapped = getWrappedScriptable(); if (wrapped instanceof Function) { return ((Function) wrapped).construct(cx, scope, args); } throw Context.reportRuntimeError(wrapped + " is not a function."); }
/** * {@inheritDoc} */ public final Scriptable construct(final Context cx, final Scriptable scope, final Object[] args) { final SimpleScriptable wrapped = getWrappedScriptable(); if (wrapped instanceof Function) { return ((Function) wrapped).construct(cx, scope, args); } throw Context.reportRuntimeError(wrapped + " is not a function."); }
/** * Creates a new JavaScript object by executing the named constructor. * * Searches <code>scope</code> for the named constructor, calls it with * the given arguments, and returns the result.<p> * * The code * <pre> * Object[] args = { "a", "b" }; * newObject(scope, "Foo", args)</pre> * is equivalent to evaluating "new Foo('a', 'b')", assuming that the Foo * constructor has been defined in <code>scope</code>. * * @param scope The scope to search for the constructor and to evaluate * against * @param constructorName the name of the constructor to call * @param args the array of arguments for the constructor * @return the new object */ public final Scriptable newObject(Scriptable scope, String constructorName, Object[] args) { scope = ScriptableObject.getTopLevelScope(scope); Function ctor = ScriptRuntime.getExistingCtor(this, scope, constructorName); if (args == null) { args = ScriptRuntime.emptyArgs; } return ctor.construct(this, scope, args); }
return f.construct(cx, topLevel, adapterArgs);
return ((Function)obj).construct(cx,scope,args);
Scriptable result = ctor.construct(cx, scope, ScriptRuntime.emptyArgs); if (thisObj instanceof NativeArray && result instanceof NativeArray) { NativeArray denseThis = (NativeArray) thisObj;
stack[stackTop] = fun.construct(cx, frame.scope, outArgs); continue Loop;