2004-11-25 Cesar Lopez Nataren <cesar@ciencias.unam.mx>
authorCésar Natarén <cesar@mono-cvs.ximian.com>
Thu, 25 Nov 2004 23:53:25 +0000 (23:53 -0000)
committerCésar Natarén <cesar@mono-cvs.ximian.com>
Thu, 25 Nov 2004 23:53:25 +0000 (23:53 -0000)
* GlobalObject.cs: return the different kinds of object's
constructors.
* DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs,
NumberConstructor.cs, VBArrayConstructor.cs,
FunctionConstructor.cs, EnumeratorConstructor.cs,
BooleanConstructor.cs, ArrayConstructor.cs, RegExpConstructor.cs,
ActiveXObjectConstructor.cs : added default constructor and static
contructor field.
* ErrorConstructor.cs: added default and discriminatory ctrs. Let
us know which type of error we are.
* DateObject.cs: add field that hold the millisecond representation of date.
* JSError.cs, JScriptException.cs: back to Microsoft.JScript namespace.
* DatePrototype.cs: add default ctr.

svn path=/trunk/mcs/; revision=36574

18 files changed:
mcs/class/Microsoft.JScript/Microsoft.JScript/ActiveXObjectConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/ArrayConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/BooleanConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog
mcs/class/Microsoft.JScript/Microsoft.JScript/DateConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/DateObject.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/DatePrototype.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/EnumeratorConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/ErrorConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/FunctionConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/GlobalObject.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/JSError.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/JScriptException.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/NumberConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/ObjectConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/RegExpConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/StringConstructor.cs
mcs/class/Microsoft.JScript/Microsoft.JScript/VBArrayConstructor.cs

index 63b33427977829b0662d8fa87245804596632fe7..f993244f8e72ad707d7f67907d0a020994c8dcbb 100644 (file)
@@ -32,6 +32,12 @@ namespace Microsoft.JScript {
 
        public class ActiveXObjectConstructor : ScriptFunction {
 
+               internal static ActiveXObjectConstructor Ctr = new ActiveXObjectConstructor ();
+
+               internal ActiveXObjectConstructor ()
+               {
+               }
+
                [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
                public new Object CreateInstance (params Object [] args)
                {
@@ -43,4 +49,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index 2022270354880dbee9d96ed6db5464cba81bb697..f8021d2bdd8f496d1e71a6cea39066068117688d 100644 (file)
@@ -33,6 +33,12 @@ namespace Microsoft.JScript {
 
        public class ArrayConstructor : ScriptFunction {
 
+               internal static ArrayConstructor Ctr = new ArrayConstructor ();
+
+               internal ArrayConstructor ()
+               {
+               }
+
                public ArrayObject ConstructArray (Object [] args)
                {
                        throw new NotImplementedException ();
@@ -51,4 +57,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index 62bb783105926f37596011d0d4dcffa7ecc093e7..276c5914579e60278d7fcf9cd535b20eca362842 100644 (file)
@@ -33,6 +33,12 @@ namespace Microsoft.JScript {
 
        public class BooleanConstructor : ScriptFunction {
 
+               internal static BooleanConstructor Ctr = new BooleanConstructor ();
+
+               internal BooleanConstructor ()
+               {
+               }
+
                [JSFunctionAttribute(JSFunctionAttributeEnum.HasVarArgs)]       
                public new BooleanObject CreateInstance (params Object [] args)
                {
@@ -44,4 +50,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index 72640ddbe67f9397dfedb7c9929770ecb244ef48..3feb9801dccf10d553b31f42582a45fd2478b929 100644 (file)
@@ -1,5 +1,19 @@
 2004-11-25  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
 
+       * GlobalObject.cs: return the different kinds of object's
+       constructors.
+       * DateConstructor.cs, StringConstructor.cs, ObjectConstructor.cs,
+       NumberConstructor.cs, VBArrayConstructor.cs,
+       FunctionConstructor.cs, EnumeratorConstructor.cs,
+       BooleanConstructor.cs, ArrayConstructor.cs, RegExpConstructor.cs,
+       ActiveXObjectConstructor.cs : added default constructor and static
+       contructor field.       
+       * ErrorConstructor.cs: added default and discriminatory ctrs. Let
+       us know which type of error we are.
+       * DateObject.cs: add field that hold the millisecond representation of date.
+       * JSError.cs, JScriptException.cs: back to Microsoft.JScript namespace.
+       * DatePrototype.cs: add default ctr.
+       
        * MathObject.cs: implement its methods.
 
 2004-11-24  Cesar Lopez Nataren  <cesar@ciencias.unam.mx>
index 44cafce40cd3e7883c3843d0608c9a99fc1aa087..6006501a42fbeb7b69e3fe9d877e4fff28e5b0f1 100644 (file)
@@ -42,6 +42,12 @@ namespace Microsoft.JScript {
                const double MS_PER_MINUTE = SECONDS_PER_MINUTE * MS_PER_SECOND;
                const double MS_PER_DAY = SECONDS_PER_DAY * MS_PER_SECOND;
 
+               internal static DateConstructor Ctr = new DateConstructor ();
+               
+               internal DateConstructor ()
+               {
+               }
+               
                [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
                public new DateObject CreateInstance (params Object[] args)
                {
index 75688d67786b5007c81301774947d118681fb5fd..7e5a5f3b9a0b848545e72add197eed2cdb7b3858 100644 (file)
 namespace Microsoft.JScript {
 
        public class DateObject : JSObject
-       {}
-}
\ No newline at end of file
+       {
+               internal double ms;
+
+               internal DateObject (double ms)
+               {
+                       this.ms = ms;
+               }
+       }
+}
index 00f6a00ea4b124db47172b915bb98bf7d67562a0..6046de4226cd6a636324da2d99716886e6e39bb0 100644 (file)
@@ -34,6 +34,11 @@ namespace Microsoft.JScript {
 
        public class DatePrototype : DateObject
        {
+               internal DatePrototype ()
+                       : base (0)
+               {
+               }
+
                public static DateConstructor constructor {
                        get { throw new NotImplementedException (); }
                }
index 5646018a5ddb291f761f08cdd583f17a904d904c..311efae0338ae44d94eb06d5efe8d15e2d32471f 100644 (file)
@@ -33,6 +33,12 @@ namespace Microsoft.JScript {
 
        public class EnumeratorConstructor : ScriptFunction {
 
+               internal static EnumeratorConstructor Ctr = new EnumeratorConstructor ();
+
+               internal EnumeratorConstructor ()
+               {
+               }
+
                [JSFunctionAttribute(JSFunctionAttributeEnum.HasVarArgs)]
                public new EnumeratorObject CreateInstance (params Object [] args)
                {
@@ -44,4 +50,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index 0ea629119d4e6512464c2324484e46d56b50ce8a..33d819f7a84d644c3fa1a6ed2c67713c096fcdca 100644 (file)
@@ -43,6 +43,24 @@ namespace Microsoft.JScript {
 
        public class ErrorConstructor : ScriptFunction {
 
+               ErrorType error_type;
+               internal static ErrorConstructor Ctr = new ErrorConstructor ();
+               internal static ErrorConstructor EvalErrorCtr = new ErrorConstructor (ErrorType.EvalError);
+               internal static ErrorConstructor RangeErrorCtr = new ErrorConstructor (ErrorType.RangeError);
+               internal static ErrorConstructor ReferenceErrorCtr = new ErrorConstructor (ErrorType.ReferenceError);
+               internal static ErrorConstructor SyntaxErrorCtr = new ErrorConstructor (ErrorType.SyntaxError);
+               internal static ErrorConstructor TypeErrorCtr = new ErrorConstructor (ErrorType.TypeError);
+               internal static ErrorConstructor URIErrorCtr = new ErrorConstructor (ErrorType.URIError);
+
+               internal ErrorConstructor ()
+               {
+               }
+
+               internal ErrorConstructor (ErrorType errorType)
+               {
+                       error_type = errorType;
+               }
+
                [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
                public new ErrorObject CreateInstance (params Object [] args)
                {
@@ -55,4 +73,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index 79f4b435aec096e5d5457dee8b4c87f56790532a..d9c598e8f614779c02ae9bf0c82de10df12b04d1 100644 (file)
@@ -33,6 +33,12 @@ namespace Microsoft.JScript {
 
        public class FunctionConstructor : ScriptFunction  {
 
+               internal FunctionConstructor Ctr = new FunctionConstructor ();
+
+               internal FunctionConstructor ()
+               {
+               }
+
                [JSFunctionAttribute(JSFunctionAttributeEnum.HasVarArgs)]
                public new ScriptFunction CreateInstance (params Object [] args)
                {
@@ -45,4 +51,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index ee155d2b6376245938ecea2abf358581d19c5faf..ac77332a2dad19643a0d741c6c9d064f0dda8fa5 100644 (file)
@@ -39,15 +39,15 @@ namespace Microsoft.JScript {
                public static readonly Empty undefined = null;
 
                public static ActiveXObjectConstructor ActiveXObject {
-                       get { throw new NotImplementedException (); }
+                       get { return ActiveXObjectConstructor.Ctr; }
                }
 
                public static ArrayConstructor Array {
-                       get { throw new NotImplementedException (); }
+                       get { return ArrayConstructor.Ctr; }
                }
 
                public static BooleanConstructor Boolean {
-                       get { throw new NotImplementedException (); }
+                       get { return BooleanConstructor.Ctr; }
                }
 
                public static Type boolean {
@@ -69,7 +69,7 @@ namespace Microsoft.JScript {
                }
 
                public static DateConstructor Date {
-                       get { throw new NotImplementedException (); }
+                       get { return DateConstructor.Ctr; }
                }
 
                public static Type @decimal {
@@ -328,11 +328,11 @@ namespace Microsoft.JScript {
                }
 
                public static EnumeratorConstructor Enumerator {
-                       get { throw new NotImplementedException (); }
+                       get { return EnumeratorConstructor.Ctr; }
                }
 
                public static ErrorConstructor Error {
-                       get { throw new NotImplementedException (); }
+                       get { return ErrorConstructor.Ctr; }
                }
 
                [JSFunctionAttribute (0, JSBuiltin.Global_escape)]
@@ -348,7 +348,7 @@ namespace Microsoft.JScript {
                }
 
                public static ErrorConstructor EvalError {
-                       get { throw new NotImplementedException (); }
+                       get { return ErrorConstructor.EvalErrorCtr; }
                }
 
                public static Type @float {
@@ -390,11 +390,11 @@ namespace Microsoft.JScript {
                }
 
                public static NumberConstructor Number {
-                       get { throw new NotImplementedException (); }
+                       get { return NumberConstructor.Ctr; }
                }
 
                public static ObjectConstructor Object {
-                       get { throw new NotImplementedException (); }
+                       get { return ObjectConstructor.Ctr; }
                }
 
                [JSFunctionAttribute (0, JSBuiltin.Global_parseFloat)]
@@ -410,15 +410,15 @@ namespace Microsoft.JScript {
                }
 
                public static ErrorConstructor RangeError {
-                       get { throw new NotImplementedException (); }
+                       get { return ErrorConstructor.RangeErrorCtr; }
                }
 
                public static ErrorConstructor ReferenceError {
-                       get { throw new NotImplementedException (); }
+                       get { return ErrorConstructor.ReferenceErrorCtr; }
                }
 
                public static RegExpConstructor RegExp {
-                       get { throw new NotImplementedException (); }
+                       get { return RegExpConstructor.Ctr; }
                }
 
                [JSFunctionAttribute (0, JSBuiltin.Global_ScriptEngine)]
@@ -454,15 +454,15 @@ namespace Microsoft.JScript {
                }
 
                public static StringConstructor String {
-                       get { throw new NotImplementedException (); }
+                       get { return StringConstructor.Ctr; }
                }
 
                public static ErrorConstructor SyntaxError {
-                       get { throw new NotImplementedException (); }
+                       get { return ErrorConstructor.SyntaxErrorCtr; }
                }
 
                public static ErrorConstructor TypeError {
-                       get { throw new NotImplementedException (); }
+                       get { return ErrorConstructor.TypeErrorCtr; }
                }
 
                [JSFunctionAttribute (0, JSBuiltin.Global_unescape)]
@@ -472,11 +472,11 @@ namespace Microsoft.JScript {
                }
 
                public static ErrorConstructor URIError {
-                       get { throw new NotImplementedException (); }
+                       get { return ErrorConstructor.URIErrorCtr; }
                }
 
                public static VBArrayConstructor VBArray {
-                       get { throw new NotImplementedException (); }
+                       get { return VBArrayConstructor.Ctr; }
                }
 
                public static Type @void {
index b2ce032e54d7278a98a642276c32a59bc56454a1..924984542ee071a41b1e58adbd45a830fae3ae9c 100644 (file)
@@ -28,8 +28,8 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace Microsoft.JScript.Tmp
-{
+namespace Microsoft.JScript {
+
        public enum JSError {
                NoError,
                InvalidCall,
index e853f874b0caae8b4f2edb3e55a65afaa4b9be4f..bd9a1c8fe6ccefed1381445bd0c0569fa3e8f3c3 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace Microsoft.JScript.Tmp
-{
-       using System;
-       using Microsoft.Vsa;
-       using System.Runtime.Serialization;
+using System;
+using Microsoft.Vsa;
+using System.Runtime.Serialization;
+
+namespace Microsoft.JScript {
 
        [Serializable]
        public class JScriptException : ApplicationException, IVsaError
@@ -123,4 +123,4 @@ namespace Microsoft.JScript.Tmp
        public class NoContextException : ApplicationException 
        {}
 }
-               
\ No newline at end of file
+               
index 4bd8058e353fe5311b5fec0490546faec8e7ba24..846e8d7d97b594440adfdcc6cefcd616b7d2ae86 100644 (file)
@@ -33,6 +33,12 @@ namespace Microsoft.JScript {
 
        public class NumberConstructor : ScriptFunction {
 
+               internal static NumberConstructor Ctr = new NumberConstructor ();
+
+               internal NumberConstructor ()
+               {
+               }
+
                public const double MAX_VALUE = Double.MaxValue;
                public const double MIN_VALUE = Double.Epsilon;
                public const double NaN = Double.NaN;
@@ -50,4 +56,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index 63c049bfd406c228991bdf585d487e0015aece93..9375528031d7f1a8bf844002734af2a7fa34250d 100644 (file)
@@ -33,6 +33,12 @@ namespace Microsoft.JScript {
 
        public class ObjectConstructor : ScriptFunction {
 
+               internal static ObjectConstructor Ctr = new ObjectConstructor ();
+
+               internal ObjectConstructor ()
+               {
+               }
+
                public JSObject ConstructObject ()
                {
                        throw new NotImplementedException ();
@@ -50,4 +56,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index eaa6e3e9f9a12b7872b6ef306fcf8c13723a4901..4e3469fba554c2dc916319af07b875ce20efc8f7 100644 (file)
@@ -33,6 +33,12 @@ namespace Microsoft.JScript {
 
        public class RegExpConstructor : ScriptFunction {
 
+               internal static RegExpConstructor Ctr = new RegExpConstructor ();
+
+               internal RegExpConstructor ()
+               {
+               }
+
                public Object Construct (string pattern, bool ignoreCase, bool global, bool multiLine)
                {
                        throw new NotImplementedException ();
@@ -79,4 +85,4 @@ namespace Microsoft.JScript {
                        get { throw new NotImplementedException (); }
                }
        }
-}
\ No newline at end of file
+}
index 5d50095a7ff636f71ee3e2f604355ea1a842e2ba..7a731849d65512d6b53ec309ac0214a2ab0dcc3c 100644 (file)
@@ -33,6 +33,12 @@ namespace Microsoft.JScript {
 
        public class StringConstructor : ScriptFunction {
 
+               internal static StringConstructor Ctr = new StringConstructor ();
+
+               internal StringConstructor ()
+               {
+               }
+
                [JSFunctionAttribute (JSFunctionAttributeEnum.HasVarArgs)]
                public new StringObject CreateInstance (params Object [] args)
                {
@@ -50,4 +56,4 @@ namespace Microsoft.JScript {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}
index 25bf1965fd4fa91a2de58b0f31a11b959e90eb18..12785380445433b009ded4c211cfd876bc50de9c 100644 (file)
@@ -33,10 +33,16 @@ namespace Microsoft.JScript {
 
        public class VBArrayConstructor : ScriptFunction {
 
+               internal static VBArrayConstructor Ctr = new VBArrayConstructor ();
+
+               internal VBArrayConstructor ()
+               {
+               }
+
                [JSFunctionAttribute(JSFunctionAttributeEnum.HasVarArgs)]
                public new Object CreateInstance (params Object [] args)
                {
                        throw new NotImplementedException ();
                }
        }
-}
\ No newline at end of file
+}