@Override protected Object getInstanceIdValue(int id) { if (id == Id_length) { return ScriptRuntime.wrapNumber(length); } return super.getInstanceIdValue(id); }
@Override protected Object getInstanceIdValue(int id) { if (id == Id_length) { return ScriptRuntime.wrapInt(string.length()); } return super.getInstanceIdValue(id); }
@Override protected Object getInstanceIdValue(int id) { switch (id) { case Id_callee: return calleeObj; case Id_length: return lengthObj; case Id_caller: { Object value = callerObj; if (value == UniqueTag.NULL_VALUE) { value = null; } else if (value == null) { NativeCall caller = activation.parentActivationCall; if (caller != null) { value = caller.get("arguments", caller); } } return value; } } return super.getInstanceIdValue(id); }
@Override protected Object getInstanceIdValue(int id) { switch (id) { case Id_lastIndex: return ScriptRuntime.wrapNumber(lastIndex); case Id_source: return new String(re.source); case Id_global: return ScriptRuntime.wrapBoolean((re.flags & JSREG_GLOB) != 0); case Id_ignoreCase: return ScriptRuntime.wrapBoolean((re.flags & JSREG_FOLD) != 0); case Id_multiline: return ScriptRuntime.wrapBoolean((re.flags & JSREG_MULTILINE) != 0); } return super.getInstanceIdValue(id); }
@Override public Object get(String name, Scriptable start) { int info = findInstanceIdInfo(name); if (info != 0) { int id = (info & 0xFFFF); return getInstanceIdValue(id); } if (prototypeValues != null) { int id = prototypeValues.findId(name); if (id != 0) { return prototypeValues.get(id); } } return super.get(name, start); }
int attr = (info >>> 16); if ((attr & PERMANENT) == 0) { if (NOT_FOUND == getInstanceIdValue(id)) { continue;
@Override public boolean has(String name, Scriptable start) { int info = findInstanceIdInfo(name); if (info != 0) { int attr = (info >>> 16); if ((attr & PERMANENT) != 0) { return true; } int id = (info & 0xFFFF); return NOT_FOUND != getInstanceIdValue(id); } if (prototypeValues != null) { int id = prototypeValues.findId(name); if (id != 0) { return prototypeValues.has(id); } } return super.has(name, start); }
@Override protected Object getInstanceIdValue(int id) { switch (id) { case Id_length: return ScriptRuntime.wrapInt(getLength()); case Id_arity: return ScriptRuntime.wrapInt(getArity()); case Id_name: return getFunctionName(); case Id_prototype: return getPrototypeProperty(); case Id_arguments: return getArguments(); } return super.getInstanceIdValue(id); }