/** * Warning: this doesn't allow to resolve primitive prototype properly when many top scopes are involved */ public static Scriptable toObjectOrNull(Context cx, Object obj) { if (obj instanceof Scriptable) { return (Scriptable)obj; } else if (obj != null && obj != Undefined.instance) { return toObject(cx, getTopCallScope(cx), obj); } return null; }
/** * Call obj.[[Get]](id) */ public static Object getObjectElem(Object obj, Object elem, Context cx) { return getObjectElem(obj, elem, cx, getTopCallScope(cx)); }
/** * Version of setObjectElem when elem is a valid JS identifier name. * * @deprecated Use {@link #setObjectProp(Object, String, Object, Context, Scriptable)} instead */ @Deprecated public static Object setObjectProp(Object obj, String property, Object value, Context cx) { return setObjectProp(obj, property, value, cx, getTopCallScope(cx)); }
/** * Version of getObjectElem when elem is a valid JS identifier name. * * @deprecated Use {@link #getObjectProp(Object, String, Context, Scriptable)} instead */ @Deprecated public static Object getObjectProp(Object obj, String property, Context cx) { return getObjectProp(obj, property, cx, getTopCallScope(cx)); }
/** * @deprecated Use {@link #enumInit(Object, Context, Scriptable, int)} instead */ @Deprecated public static Object enumInit(Object value, Context cx, int enumType) { return enumInit(value, cx, getTopCallScope(cx), enumType); }
/** * @deprecated Use {@link #getObjectPropNoWarn(Object, String, Context, Scriptable)} instead */ @Deprecated public static Object getObjectPropNoWarn(Object obj, String property, Context cx) { return getObjectPropNoWarn(obj, property, cx, getTopCallScope(cx)); }
/** * A cheaper and less general version of the above for well-known argument * types. * * @deprecated Use {@link #getObjectIndex(Object, double, Context, Scriptable)} instead */ @Deprecated public static Object getObjectIndex(Object obj, double dblIndex, Context cx) { return getObjectIndex(obj, dblIndex, cx, getTopCallScope(cx)); }
/** * @deprecated Use {@link #refSet(Ref, Object, Context, Scriptable)} instead */ @Deprecated public static Object refSet(Ref ref, Object value, Context cx) { return refSet(ref, value, cx, getTopCallScope(cx)); }
/** * Call obj.[[Get]](id) * * @deprecated Use {@link #getObjectElem(Object, Object, Context, Scriptable)} instead */ @Deprecated public static Object getObjectElem(Object obj, Object elem, Context cx) { return getObjectElem(obj, elem, cx, getTopCallScope(cx)); }
/** * A cheaper and less general version of the above for well-known argument * types. * * @deprecated Use {@link #setObjectIndex(Object, double, Object, Context, Scriptable)} instead */ @Deprecated public static Object setObjectIndex(Object obj, double dblIndex, Object value, Context cx) { return setObjectIndex(obj, dblIndex, value, cx, getTopCallScope(cx)); }
/** * @deprecated Use {@link #refIncrDecr(Ref, Context, Scriptable, int)} instead */ @Deprecated public static Object refIncrDecr(Ref ref, Context cx, int incrDecrMask) { return refIncrDecr(ref, cx, getTopCallScope(cx), incrDecrMask); }
/** * Call obj.[[Put]](id, value) * * @deprecated Use {@link #setObjectElem(Object, Object, Object, Context, Scriptable)} instead */ @Deprecated public static Object setObjectElem(Object obj, Object elem, Object value, Context cx) { return setObjectElem(obj, elem, value, cx, getTopCallScope(cx)); }
/** * @deprecated Use {@link #specialRef(Object, String, Context, Scriptable)} instead */ @Deprecated public static Ref specialRef(Object obj, String specialProperty, Context cx) { return specialRef(obj, specialProperty, cx, getTopCallScope(cx)); }
/** * Call obj.[[Get]](id) */ public static Object getObjectElem(Object obj, Object elem, Context cx) { return getObjectElem(obj, elem, cx, getTopCallScope(cx)); }
/** * Warning: this doesn't allow to resolve primitive prototype properly when many top scopes are involved */ public static Scriptable toObjectOrNull(Context cx, Object obj) { if (obj instanceof Scriptable) { return (Scriptable)obj; } else if (obj != null && obj != Undefined.instance) { return toObject(cx, getTopCallScope(cx), obj); } return null; }
/** * Warning: this doesn't allow to resolve primitive prototype properly when many top scopes are involved */ public static Scriptable toObjectOrNull(Context cx, Object obj) { if (obj instanceof Scriptable) { return (Scriptable)obj; } else if (obj != null && obj != Undefined.instance) { return toObject(cx, getTopCallScope(cx), obj); } return null; }
/** * Warning: this doesn't allow to resolve primitive prototype properly when many top scopes are involved */ public static Scriptable toObjectOrNull(Context cx, Object obj) { if (obj instanceof Scriptable) { return (Scriptable)obj; } else if (obj != null && obj != Undefined.instance) { return toObject(cx, getTopCallScope(cx), obj); } return null; }
@Override public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] extraArgs) { Scriptable callThis = boundThis != null ? boundThis : ScriptRuntime.getTopCallScope(cx); return targetFunction.call(cx, scope, callThis, concat(boundArgs, extraArgs)); }
@Override public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] extraArgs) { Scriptable callThis = boundThis != null ? boundThis : ScriptRuntime.getTopCallScope(cx); return targetFunction.call(cx, scope, callThis, concat(boundArgs, extraArgs)); }
@Override public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] extraArgs) { Scriptable callThis = boundThis != null ? boundThis : ScriptRuntime.getTopCallScope(cx); return targetFunction.call(cx, scope, callThis, concat(boundArgs, extraArgs)); }