[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as
From: |
Sandro Santilli |
Subject: |
Re: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as |
Date: |
Fri, 31 Aug 2007 17:59:37 +0200 |
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] gnash ChangeLog testsuite/actionscript.all/ops.as, Zou Lunkai, 2007/08/01
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as, Zou Lunkai, 2007/08/02
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as, Sandro Santilli, 2007/08/02
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as, Zou Lunkai, 2007/08/06
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as, Sandro Santilli, 2007/08/06
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as, Sandro Santilli, 2007/08/19
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as, Sandro Santilli, 2007/08/25
- [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/ops.as, Zou Lunkai, 2007/08/26