//
using System;
+using System.Diagnostics;
+using System.Globalization;
namespace Microsoft.JScript {
public sealed class Plus : BinaryOp {
public Plus ()
+ : base (null, null, null, JSToken.Plus, null)
{
}
- public object EvaluatePlus (object v1, object v2)
+ [DebuggerStepThroughAttribute]
+ [DebuggerHiddenAttribute]
+ public object EvaluatePlus (object v1, object v2)
{
- if (v1 is String && v2 is String)
- return String.Concat (v1, v2);
+ object val1 = Convert.ToPrimitive (v1, null);
+ object val2 = Convert.ToPrimitive (v2, null);
+ if (Convert.IsString (val1) || Convert.IsString (val2))
+ return Convert.ToString (val1) + Convert.ToString (val2);
else
- return new object ();
+ return Convert.ToNumber (val1) + Convert.ToNumber (val2);
}
public static object DoOp (object v1, object v2)
throw new NotImplementedException ();
}
- internal override bool Resolve (IdentificationTable context)
+ internal override bool Resolve (Environment env)
{
throw new NotImplementedException ();
}
- internal override bool Resolve (IdentificationTable context, bool no_effect)
+ internal override bool Resolve (Environment env, bool no_effect)
{
throw new NotImplementedException ();
}