コード例 #1
0
 public static bool IsContinuationConstructor (IdFunctionObject f)
 {
     if (f.HasTag (FTAG) && f.MethodId == Id_constructor) {
         return true;
     }
     return false;
 }
コード例 #2
0
 public static bool IsContinuationConstructor(IdFunctionObject f)
 {
     if (f.HasTag(FTAG) && f.MethodId == Id_constructor)
     {
         return(true);
     }
     return(false);
 }
コード例 #3
0
        public override object ExecIdCall(IdFunctionObject f, Context cx, IScriptable scope, IScriptable thisObj, object [] args)
        {
            if (!f.HasTag (FTAG)) {
                return base.ExecIdCall (f, cx, scope, thisObj, args);
            }
            int id = f.MethodId;
            switch (id) {

                case Id_constructor:
                    throw Context.ReportRuntimeError ("Direct call is not supported");
            }
            throw new ArgumentException (Convert.ToString (id));
        }
コード例 #4
0
        public override object ExecIdCall(IdFunctionObject f, Context cx, IScriptable scope, IScriptable thisObj, object [] args)
        {
            if (!f.HasTag(FTAG))
            {
                return(base.ExecIdCall(f, cx, scope, thisObj, args));
            }
            int id = f.MethodId;

            switch (id)
            {
            case Id_constructor:
                throw Context.ReportRuntimeError("Direct call is not supported");
            }
            throw new ArgumentException(Convert.ToString(id));
        }
コード例 #5
0
        public override object ExecIdCall(IdFunctionObject f, Context cx, IScriptable scope, IScriptable thisObj, object [] args)
        {
            if (!f.HasTag(FUNCTION_TAG))
            {
                return(base.ExecIdCall(f, cx, scope, thisObj, args));
            }
            int id = f.MethodId;

            switch (id)
            {
            case Id_constructor:
                return(JsConstructor(cx, scope, args));


            case Id_toString: {
                BaseFunction realf  = RealFunction(thisObj, f);
                int          indent = ScriptConvert.ToInt32(args, 0);
                return(realf.Decompile(indent, Decompiler.TO_STRING_FLAG));
            }


            case Id_toSource: {
                BaseFunction realf  = RealFunction(thisObj, f);
                int          indent = 0;
                int          flags  = Decompiler.TO_SOURCE_FLAG;
                if (args.Length != 0)
                {
                    indent = ScriptConvert.ToInt32(args [0]);
                    if (indent >= 0)
                    {
                        flags = 0;
                    }
                    else
                    {
                        indent = 0;
                    }
                }
                return(realf.Decompile(indent, flags));
            }


            case Id_apply:
            case Id_call:
                return(ScriptRuntime.applyOrCall(id == Id_apply, cx, scope, thisObj, args));
            }
            throw new ArgumentException(Convert.ToString(id));
        }
コード例 #6
0
        public override object ExecIdCall (IdFunctionObject f, Context cx, IScriptable scope, IScriptable thisObj, object [] args)
        {
            if (!f.HasTag (NAMESPACE_TAG)) {
                return base.ExecIdCall (f, cx, scope, thisObj, args);
            }
            int id = f.MethodId;
            switch (id) {

                case Id_constructor:
                    return jsConstructor (cx, (thisObj == null), args);

                case Id_toString:
                    return realThis (thisObj, f).ToString ();

                case Id_toSource:
                    return realThis (thisObj, f).js_toSource ();
            }
            throw new System.ArgumentException (System.Convert.ToString (id));
        }
コード例 #7
0
        public override object ExecIdCall(IdFunctionObject f, Context cx, IScriptable scope, IScriptable thisObj, object [] args)
        {
            if (!f.HasTag (FUNCTION_TAG)) {
                return base.ExecIdCall (f, cx, scope, thisObj, args);
            }
            int id = f.MethodId;
            switch (id) {

                case Id_constructor:
                    return JsConstructor (cx, scope, args);

                case Id_toString: {
                        BaseFunction realf = RealFunction (thisObj, f);
                        int indent = ScriptConvert.ToInt32 (args, 0);
                        return realf.Decompile (indent, Decompiler.TO_STRING_FLAG);
                    }

                case Id_toSource: {
                        BaseFunction realf = RealFunction (thisObj, f);
                        int indent = 0;
                        int flags = Decompiler.TO_SOURCE_FLAG;
                        if (args.Length != 0) {
                            indent = ScriptConvert.ToInt32 (args [0]);
                            if (indent >= 0) {
                                flags = 0;
                            }
                            else {
                                indent = 0;
                            }
                        }
                        return realf.Decompile (indent, flags);
                    }

                case Id_apply:
                case Id_call:
                    return ScriptRuntime.applyOrCall (id == Id_apply, cx, scope, thisObj, args);
            }
            throw new ArgumentException (Convert.ToString (id));
        }
コード例 #8
0
        public override object ExecIdCall(IdFunctionObject f, Context cx, IScriptable scope, IScriptable thisObj, object [] args)
        {
            if (!f.HasTag (REGEXP_TAG)) {
                return base.ExecIdCall (f, cx, scope, thisObj, args);
            }
            int id = f.MethodId;
            switch (id) {

                case Id_compile:
                    return realThis (thisObj, f).compile (cx, scope, args);

                case Id_toString:
                case Id_toSource:
                    return realThis (thisObj, f).ToString ();

                case Id_exec:
                    return realThis (thisObj, f).execSub (cx, scope, args, MATCH);

                case Id_test: {
                        object x = realThis (thisObj, f).execSub (cx, scope, args, TEST);
                        return true.Equals (x) ? true : false;
                    }

                case Id_prefix:
                    return realThis (thisObj, f).execSub (cx, scope, args, PREFIX);
            }
            throw new ArgumentException (Convert.ToString (id));
        }