예제 #1
0
        public ObjectInstance Construct(JsValue[] arguments)
        {
            var instance = new ErrorInstance(Engine, _name);

            instance.Prototype  = PrototypeObject;
            instance.Extensible = true;

            if (arguments.At(0) != Undefined.Instance)
            {
                instance.Put("message", TypeConverter.ToString(arguments.At(0)), false);
            }
            try
            {
                if (arguments.At(1) != Undefined.Instance)
                {
                    instance.Put("trace", TypeConverter.ToString(arguments.At(1)), false);
                }
                else
                {
                    instance.Put("trace", TypeConverter.ToString(arguments.At(0)), false);
                }
            }
            catch { }


            return(instance);
        }
예제 #2
0
        public ObjectInstance Construct(JsValue[] arguments)
        {
            var instance = new ErrorInstance(Engine, _name);
            instance.Prototype = PrototypeObject;
            instance.Extensible = true;

            if (arguments.At(0) != Undefined.Instance)
            {
                instance.Put("message", TypeConverter.ToString(arguments.At(0)), false);
            }

            return instance;
        }
예제 #3
0
        public ObjectInstance Construct(JsValue[] arguments)
        {
            var instance = new ErrorInstance(Engine, _name);

            instance.Prototype  = PrototypeObject;
            instance.Extensible = true;

            var jsValue = arguments.At(0);

            if (!jsValue.IsUndefined())
            {
                instance.Put("message", TypeConverter.ToString(jsValue), false);
            }

            return(instance);
        }
예제 #4
0
        public ObjectInstance Construct(JsValue[] arguments, JsValue newTarget)
        {
            var instance = new ErrorInstance(Engine, _name);

            instance._prototype = PrototypeObject;

            var jsValue = arguments.At(0);

            if (!jsValue.IsUndefined())
            {
                var msg     = TypeConverter.ToString(jsValue);
                var msgDesc = new PropertyDescriptor(msg, true, false, true);
                instance.DefinePropertyOrThrow("message", msgDesc);
            }

            return(instance);
        }