public static Scriptable toObject(Scriptable scope, Object val) { if (val instanceof Scriptable) { return (Scriptable)val; } return toObject(Context.getContext(), scope, val); }
/** * @deprecated Use {@link #toObject(Scriptable, Object)} instead. */ public static Scriptable toObject(Scriptable scope, Object val, Class<?> staticClass) { if (val instanceof Scriptable) { return (Scriptable)val; } return toObject(Context.getContext(), scope, val); }
public static Scriptable toObject(Scriptable scope, Object val) { if (val instanceof Scriptable) { return (Scriptable)val; } return toObject(Context.getContext(), scope, val); }
public static Scriptable toObject(Scriptable scope, Object val) { if (val instanceof Scriptable) { return (Scriptable)val; } return toObject(Context.getContext(), scope, val); }
/** * @deprecated Use {@link #toObject(Scriptable, Object)} instead. */ public static Scriptable toObject(Scriptable scope, Object val, Class<?> staticClass) { if (val instanceof Scriptable) { return (Scriptable)val; } return toObject(Context.getContext(), scope, val); }
/** * @deprecated Use {@link #toObject(Scriptable, Object)} instead. */ @Deprecated public static Scriptable toObject(Scriptable scope, Object val, Class<?> staticClass) { if (val instanceof Scriptable) { return (Scriptable)val; } return toObject(Context.getContext(), scope, val); }
@Override public Object getDefaultValue(Class<?> hint) { if (hint == ScriptRuntime.NumberClass) { Context cx = Context.getContext(); if (cx.getLanguageVersion() == Context.VERSION_1_2) return new Long(length); } return super.getDefaultValue(hint); }
@Override public Object get(int index, Scriptable start) { if (0 <= index && index < length) { Context cx = Context.getContext(); Object obj = Array.get(array, index); return cx.getWrapFactory().wrap(cx, this, obj, cls); } return Undefined.instance; }
@Override public Object get(int index, Scriptable start) { if (0 <= index && index < length) { Context cx = Context.getContext(); Object obj = Array.get(array, index); return cx.getWrapFactory().wrap(cx, this, obj, cls); } return Undefined.instance; }
/** * @deprecated Use {@link Context#getWrapFactory()} together with calling {@link * WrapFactory#wrap(Context, Scriptable, Object, Class)} */ @Deprecated public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) { Context cx = Context.getContext(); return cx.getWrapFactory().wrap(cx, scope, obj, staticType); }
@Override public Object getDefaultValue(Class<?> hint) { if (hint == ScriptRuntime.NumberClass) { Context cx = Context.getContext(); if (cx.getLanguageVersion() == Context.VERSION_1_2) return Long.valueOf(length); } return super.getDefaultValue(hint); }
public Object getDefaultValue(Class hint) { if (hint == ScriptRuntime.NumberClass) { Context cx = Context.getContext(); if (cx.getLanguageVersion() == Context.VERSION_1_2) return new Long(length); } return super.getDefaultValue(hint); }
/** @deprecated Use {@link Context#getWrapFactory()} together with calling {@link WrapFactory#wrap(Context, Scriptable, Object, Class)} */ public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) { Context cx = Context.getContext(); return cx.getWrapFactory().wrap(cx, scope, obj, staticType); }
/** @deprecated Use {@link Context#getWrapFactory()} together with calling {@link WrapFactory#wrap(Context, Scriptable, Object, Class)} */ public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) { Context cx = Context.getContext(); return cx.getWrapFactory().wrap(cx, scope, obj, staticType); }
/** @deprecated Use {@link Context#getWrapFactory()} together with calling {@link WrapFactory#wrap(Context, Scriptable, Object, Class)} */ public static Object wrap(Scriptable scope, Object obj, Class<?> staticType) { Context cx = Context.getContext(); return cx.getWrapFactory().wrap(cx, scope, obj, staticType); }
/** @deprecated Use {@link Context#getWrapFactory()} together with calling {@link WrapFactory#wrap(Context cx, Scriptable scope, Object obj, Class)} */ public static Object wrap(Scriptable scope, Object obj, Class staticType) { Context cx = Context.getContext(); return cx.getWrapFactory().wrap(cx, scope, obj, staticType); }
/** * The typeof operator that correctly handles the undefined case */ public static String typeofName(Scriptable scope, String id) { Context cx = Context.getContext(); Scriptable val = bind(cx, scope, id); if (val == null) return "undefined"; return typeof(getObjectProp(val, id, cx)); }
/** * The typeof operator that correctly handles the undefined case */ public static String typeofName(Scriptable scope, String id) { Context cx = Context.getContext(); Scriptable val = bind(cx, scope, id); if (val == null) return "undefined"; return typeof(getObjectProp(val, id, cx)); }
/** * The typeof operator that correctly handles the undefined case */ public static String typeofName(Scriptable scope, String id) { Context cx = Context.getContext(); Scriptable val = bind(cx, scope, id); if (val == null) return "undefined"; return typeof(getObjectProp(val, id, cx)); }
/** * The typeof operator that correctly handles the undefined case */ public static String typeofName(Scriptable scope, String id) { Context cx = Context.getContext(); Scriptable val = bind(cx, scope, id); if (val == null) return "undefined"; return typeof(getObjectProp(val, id, cx)); }