public Arguments(BuiltinCall activation) { this.activation = activation; IScriptable parent = activation.ParentScope; ParentScope = parent; SetPrototype(ScriptableObject.GetObjectPrototype(parent)); args = activation.originalArgs; lengthObj = (int)args.Length; BuiltinFunction f = activation.function; calleeObj = f; Context.Versions version = f.LanguageVersion; if (version <= Context.Versions.JS1_3 && version != Context.Versions.Default) { callerObj = null; } else { callerObj = UniqueTag.NotFound; } }
protected internal override 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.NullValue) { value = null; } else if (value == null) { BuiltinCall caller = activation.parentActivationCall; if (caller != null) { value = caller.Get("arguments", caller); } else { value = null; } } return(value); } } return(base.GetInstanceIdValue(id)); }