Example #1
0
        internal static BuiltinError make (Context cx, IScriptable scope, IdFunctionObject ctorObj, object [] args)
        {
            IScriptable proto = (IScriptable)(ctorObj.Get ("prototype", ctorObj));

            BuiltinError obj = new BuiltinError ();
            obj.SetPrototype (proto);
            obj.ParentScope = scope;

            if (args.Length >= 1) {
                ScriptableObject.PutProperty (obj, "message", ScriptConvert.ToString (args [0]));
                if (args.Length >= 2) {
                    ScriptableObject.PutProperty (obj, "fileName", args [1]);
                    if (args.Length >= 3) {
                        int line = ScriptConvert.ToInt32 (args [2]);
                        ScriptableObject.PutProperty (obj, "lineNumber", (object)line);
                    }
                }
            }
            return obj;
        }
Example #2
0
        internal static BuiltinError make(Context cx, IScriptable scope, IdFunctionObject ctorObj, object [] args)
        {
            IScriptable proto = (IScriptable)(ctorObj.Get("prototype", ctorObj));

            BuiltinError obj = new BuiltinError();

            obj.SetPrototype(proto);
            obj.ParentScope = scope;

            if (args.Length >= 1)
            {
                ScriptableObject.PutProperty(obj, "message", ScriptConvert.ToString(args [0]));
                if (args.Length >= 2)
                {
                    ScriptableObject.PutProperty(obj, "fileName", args [1]);
                    if (args.Length >= 3)
                    {
                        int line = ScriptConvert.ToInt32(args [2]);
                        ScriptableObject.PutProperty(obj, "lineNumber", (object)line);
                    }
                }
            }
            return(obj);
        }