On Mon, Aug 27, 2007 at 11:50:03AM +0800, zou lunkai wrote: > > x = new String("a"); > > y = --x; > > +check_equals(typeof(y), 'number'); > > +xcheck(y!=NaN); // uh ? is it a different NaN ? > > +check(! (NaN!=NaN)); > > check(isNaN(y)); > > +check(isNaN(NaN)); > > Tests confirmed. > > yes, y might be a differnt NaN(y is an object). > > see added tests below: > > +x = new Number(NaN); > +y = NaN; > +check(isNaN(x)); > +check(isNaN(y)); > +xcheck(x != y); ----->[1] > > As we see, [1] should return true. All I can think about is that x > is an Number object, and y is a primitive number. Doesn't mean much, > but might help the valueOf model...
ECMA states that if one of the operand in an equality operation is a number, and the other is an object, then the object is converted to a primitive type (in this case, a number) and that value is used in comparison. Try: five = new Number(5); check(five == 5); check(five != 6); NaN seems a special case... --strk; _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit