public Arguments(NativeCall activation) { this.activation = activation; Scriptable parent = activation.GetParentScope(); SetParentScope(parent); SetPrototype(ScriptableObject.GetObjectPrototype(parent)); args = activation.originalArgs; lengthObj = Sharpen.Extensions.ValueOf(args.Length); NativeFunction f = activation.function; calleeObj = f; Scriptable topLevel = GetTopLevelScope(parent); constructor = GetProperty(topLevel, "Object"); int version = f.GetLanguageVersion(); if (version <= Context.VERSION_1_3 && version != Context.VERSION_DEFAULT) { callerObj = null; } else { callerObj = ScriptableConstants.NOT_FOUND; } }
internal static void Init(Scriptable scope, bool @sealed) { Rhino.NativeCall obj = new Rhino.NativeCall(); obj.ExportAsJSClass(MAX_PROTOTYPE_ID, scope, @sealed); }
public override object ExecIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, object[] args) { if (!f.HasTag(CALL_TAG)) { return base.ExecIdCall(f, cx, scope, thisObj, args); } int id = f.MethodId(); if (id == Id_constructor) { if (thisObj != null) { throw Context.ReportRuntimeError1("msg.only.from.new", "Call"); } ScriptRuntime.CheckDeprecated(cx, "Call"); Rhino.NativeCall result = new Rhino.NativeCall(); result.SetPrototype(GetObjectPrototype(scope)); return result; } throw new ArgumentException(id.ToString()); }