Пример #1
0
        public override object ExecIdCall(IdFunctionObject f, Context cx, IScriptable scope, IScriptable 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.ReportRuntimeErrorById("msg.only.from.new", "Call");
                }
                ScriptRuntime.checkDeprecated(cx, "Call");
                BuiltinCall result = new BuiltinCall();
                result.SetPrototype(GetObjectPrototype(scope));
                return(result);
            }
            throw new ArgumentException(Convert.ToString(id));
        }
Пример #2
0
 public override object ExecIdCall(IdFunctionObject f, Context cx, IScriptable scope, IScriptable 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.ReportRuntimeErrorById ("msg.only.from.new", "Call");
         }
         ScriptRuntime.checkDeprecated (cx, "Call");
         BuiltinCall result = new BuiltinCall ();
         result.SetPrototype (GetObjectPrototype (scope));
         return result;
     }
     throw new ArgumentException (Convert.ToString (id));
 }