dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/JScript/Builtins ArrayObject.cs,1.1,1


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/JScript/Builtins ArrayObject.cs,1.1,1.2 FunctionObject.cs,1.1,1.2
Date: Tue, 21 Jan 2003 17:11:51 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/JScript/Builtins
In directory subversions:/tmp/cvs-serv20060/JScript/Builtins

Modified Files:
        ArrayObject.cs FunctionObject.cs 
Log Message:


Implement function calls; "for-in" statements; variable declarations;
property enums.


Index: ArrayObject.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/JScript/Builtins/ArrayObject.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ArrayObject.cs      13 Jan 2003 10:53:19 -0000      1.1
--- ArrayObject.cs      21 Jan 2003 22:11:49 -0000      1.2
***************
*** 23,26 ****
--- 23,27 ----
  
  using System;
+ using System.Collections;
  
  public class ArrayObject : JSObject
***************
*** 67,70 ****
--- 68,144 ----
                                // This exists for backwards-compatibility, but 
there
                                // is actually no way to call it from user code.
+                       }
+ 
+       // Get a property from this object.  Null if not present.
+       internal override Object Get(String name)
+                       {
+                               if(name == "length")
+                               {
+                                       return length;
+                               }
+                               else
+                               {
+                                       return base.Get(name);
+                               }
+                       }
+ 
+       // Get a property from this object by numeric index.
+       internal override Object GetIndex(int index)
+                       {
+                               if(!isSparse && index >= 0 && ((uint)index) < 
arrayLen)
+                               {
+                                       return array[index];
+                               }
+                               else
+                               {
+                                       return 
base.Get(Convert.ToString(index));
+                               }
+                       }
+ 
+       // Put a property to this object.
+       internal override void Put(String name, Object value)
+                       {
+                               if(name == "length")
+                               {
+                                       length = value;
+                               }
+                               else
+                               {
+                                       // TODO
+                               }
+                       }
+ 
+       // Put a property to this object by numeric index.
+       internal override void PutIndex(int index, Object value)
+                       {
+                               // TODO
+                       }
+ 
+       // Determine if this object has a specific property.
+       internal override bool HasOwnProperty(String name)
+                       {
+                               // TODO
+                               return false;
+                       }
+ 
+       // Delete a property from this object.
+       internal override bool Delete(String name)
+                       {
+                               // TODO
+                               return true;
+                       }
+ 
+       // Get the default value for this object.
+       internal override Object DefaultValue(DefaultValueHint hint)
+                       {
+                               // TODO
+                               return null;
+                       }
+ 
+       // Get an enumerator for the properties in this object.
+       internal override IEnumerator GetPropertyEnumerator()
+                       {
+                               // TODO
+                               return null;
                        }
  

Index: FunctionObject.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/JScript/Builtins/FunctionObject.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** FunctionObject.cs   17 Jan 2003 06:34:46 -0000      1.1
--- FunctionObject.cs   21 Jan 2003 22:11:49 -0000      1.2
***************
*** 51,56 ****
        internal override Object Call(Object thisob, Object[] args)
                        {
!                               // TODO
!                               return null;
                        }
  
--- 51,86 ----
        internal override Object Call(Object thisob, Object[] args)
                        {
!                               // Create a new scope object and initialize the 
parameters.
!                               ScriptObject scope;
!                               if(thisob is JSObject)
!                               {
!                                       scope = new FunctionScope
!                                               ((JSObject)thisob, 
defn.fparams, thisob, args);
!                               }
!                               else
!                               {
!                                       scope = new FunctionScope
!                                               (declaringScope, defn.fparams, 
thisob, args);
!                               }
! 
!                               // Push the scope onto the stack.
!                               engine.PushScriptObjectChecked(scope);
! 
!                               // Call the function and pop the scope 
afterwards.
!                               Object result = Empty.Value;
!                               try
!                               {
!                                       if(defn.body != null)
!                                       {
!                                               defn.body.Eval(engine);
!                                       }
!                               }
!                               finally
!                               {
!                                       engine.PopScriptObject();
!                               }
! 
!                               // Return the function result to the caller.
!                               return result;
                        }
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]