Author: cesar
Date: 2005-11-25 18:41:09 -0500 (Fri, 25 Nov 2005)
New Revision: 53489
Modified:
trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog
trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/LateBinding.cs
trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/expression.cs
Log:
2005-11-25 Cesar Lopez Nataren <[EMAIL PROTECTED]>
* expression.cs (Call.Emit): implement the case when the invoked
method at call is a property.
* Latebinding.cs: return null in case we don't mach anything.
Modified: trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog
===================================================================
--- trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog
2005-11-25 23:30:19 UTC (rev 53488)
+++ trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/ChangeLog
2005-11-25 23:41:09 UTC (rev 53489)
@@ -1,3 +1,10 @@
+2005-11-25 Cesar Lopez Nataren <[EMAIL PROTECTED]>
+
+ * expression.cs (Call.Emit): implement the case when the invoked
+ method at call is a property.
+
+ * Latebinding.cs: return null in case we don't mach anything.
+
2005-11-22 Cesar Lopez Nataren <[EMAIL PROTECTED]>
* Statement.cs (Return.Resolve): Added field exp_returns_void
Modified: trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/LateBinding.cs
===================================================================
--- trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/LateBinding.cs
2005-11-25 23:30:19 UTC (rev 53488)
+++ trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/LateBinding.cs
2005-11-25 23:41:09 UTC (rev 53489)
@@ -263,7 +263,8 @@
else if (val is RegExpObject) {
object first_arg = arguments.Length > 0
? arguments [0] : null;
return RegExpPrototype.exec (val,
first_arg);
- }
+ } else
+ return null;
}
Console.WriteLine ("CallValue: construct = {0},
brackets = {1}, this = {2}, val = {3} ({4}), arg[0] = {5}",
Modified: trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/expression.cs
===================================================================
--- trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/expression.cs
2005-11-25 23:30:19 UTC (rev 53488)
+++ trunk/mcs/class/Microsoft.JScript/Microsoft.JScript/expression.cs
2005-11-25 23:41:09 UTC (rev 53489)
@@ -865,6 +865,43 @@
Type return_type = method.ReturnType;
if (return_type != typeof (void) &&
return_type != typeof (string))
ig.Emit (OpCodes.Box,
return_type);
+ } else if (member_type == MemberTypes.Property)
{
+ if (member_exp is Binary) {
+ Binary bin = (Binary)
member_exp;
+
+ bin.left.Emit (ec);
+
+ bool in_func = InFunction;
+ CodeGenerator.load_engine
(in_func, ig);
+ ig.Emit (OpCodes.Call, typeof
(Convert).GetMethod ("ToObject2"));
+
+ if (bin.left is Identifier) {
+ Type coerce_to = null;
+ if (((Identifier)
bin.left).name.Value == "Function")
+ coerce_to =
typeof (FunctionConstructor);
+
+ LocalBuilder ctr = null;
+
+ if (coerce_to != null) {
+ ig.Emit
(OpCodes.Castclass, coerce_to);
+ ctr =
ig.DeclareLocal (coerce_to);
+ }
+
+ ig.Emit (OpCodes.Dup);
+ ig.Emit (OpCodes.Stloc,
ctr);
+ bin.Emit (ec);
+
+ ig.Emit
(OpCodes.Ldc_I4, args.Size);
+ ig.Emit
(OpCodes.Newarr, typeof (object));
+
+ ig.Emit
(OpCodes.Ldc_I4_0);
+ ig.Emit
(OpCodes.Ldc_I4_0);
+
+
CodeGenerator.load_engine (in_func, ig);
+
+ ig.Emit (OpCodes.Call,
typeof (LateBinding).GetMethod ("CallValue"));
+ }
+ }
} else {
Console.WriteLine ("member_type = {0}",
member_type);
Console.WriteLine ("member_exp = {0}",
member_exp);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches