Author: cesar
Date: 2006-01-17 12:15:59 -0500 (Tue, 17 Jan 2006)
New Revision: 55683

Modified:
   trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog
   trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/expression.cs
Log:
2006-01-17  Cesar Lopez Nataren  <[EMAIL PROTECTED]>

        * expression.cs (Binary.emit_access): Emit late binding code for
        member's access that maps to MemberTypes (like Math.pow). Fixes
        #72440.

Modified: trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog
===================================================================
--- trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog       
2006-01-17 17:14:01 UTC (rev 55682)
+++ trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog       
2006-01-17 17:15:59 UTC (rev 55683)
@@ -1,3 +1,9 @@
+2006-01-17  Cesar Lopez Nataren  <[EMAIL PROTECTED]>
+
+       * expression.cs (Binary.emit_access): Emit late binding code for
+       member's access that maps to MemberTypes (like Math.pow). Fixes
+       #72440.
+
 2006-01-13  Cesar Lopez Nataren  <[EMAIL PROTECTED]>
 
        * ForIn.cs: implement for (x in obj) logic.

Modified: trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/expression.cs
===================================================================
--- trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/expression.cs   
2006-01-17 17:14:01 UTC (rev 55682)
+++ trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/expression.cs   
2006-01-17 17:15:59 UTC (rev 55683)
@@ -381,7 +381,24 @@
                                ig.Emit (OpCodes.Call, decl_type.GetProperty 
(property.Name).GetGetMethod ());
                                break;
                        default:
-                               throw new NotImplementedException ();
+                               Type lb_type = typeof (LateBinding);
+                               LocalBuilder lateBinder = ig.DeclareLocal 
(lb_type);
+                               Identifier prop = (Identifier) prop_name;
+
+                               ig.Emit (OpCodes.Ldstr, prop.name.Value);
+                               ig.Emit (OpCodes.Newobj, lb_type.GetConstructor 
(new Type [] { typeof (string)} ));
+                               ig.Emit (OpCodes.Stloc, lateBinder);
+                               ig.Emit (OpCodes.Ldloc, lateBinder);
+                               ig.Emit (OpCodes.Dup);
+
+                               Identifier obj_name = (Identifier) obj;
+
+                               ig.Emit (OpCodes.Call, typeof 
(GlobalObject).GetProperty (obj_name.name.Value).GetGetMethod ());
+                               ig.Emit (OpCodes.Stfld, lb_type.GetField 
("obj"));
+                               ig.Emit (OpCodes.Call, lb_type.GetMethod 
("GetNonMissingValue"));
+
+                               break;
+
                        }
                        emit_box (ig, minfo);
                }                       

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to