[Mono-devel-list] PATCH: EvaluateRelational for Mono JScript.NET

César López Natarén cnataren at novell.com
Sun Feb 13 18:31:32 EST 2005


On Sun, 2005-02-13 at 07:59 -0400, Rogerio Pereira wrote: 
> Hi,

Hello Rogerio. 

Thanks for the patch, it goes through the correct path but I have some
comments:

> switch (op) {
>     case JSToken.GreaterThan:
>     ....
>     case JSToken.LessThan:
> ...
> switch (op) {
> case JSToken.GreaterThan:

You can avoid duplicating the checks for the operator in each pair of
type
code's combination, if you put the switch of the op the most global
level, and inside it you check the type code of the operands, also you
can put those checks inside another function and use it where is needed.

Different .NET numeric types get grouped and other types get converted
to numeric types.

Take a look at this two places for completing the patch:

http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

section 11.4.

And
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsgrpcomparison.asp



Greetings.
Cesar





More information about the Mono-devel-list mailing list