[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Numb...
From: |
zou lunkai |
Subject: |
Re: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Numb... |
Date: |
Mon, 17 Sep 2007 14:26:13 +0800 |
strk,
see tests:
var x1 = Number(268);
var x2 = new Number(268);
Compiled with makeswf, dumped with listswf. got:
SWFACTION_CONSTANTPOOL
[000] Number
[001] x1
[002] x2
SWFACTION_PUSH
[000] Constant: 1 "x1"
[001] Integer: 268
[002] Integer: 1
[003] Constant: 0 "Number"
SWFACTION_CALLFUNCTION
SWFACTION_DEFINELOCAL
SWFACTION_PUSH
[000] Constant: 2 "x2"
[001] Integer: 268
[002] Integer: 1
[003] Constant: 0 "Number"
SWFACTION_NEWOBJECT
SWFACTION_DEFINELOCAL
SWFACTION_END
So, x1 is the result of CALLFUNCTION and x2 is the result of NEWOBJECT.
Shouldn't they have different types as we expect?
--zou
On 9/17/07, Sandro Santilli <address@hidden> wrote:
> CVSROOT: /sources/gnash
> Module name: gnash
> Changes by: Sandro Santilli <strk> 07/09/17 05:55:38
>
> Modified files:
> . : ChangeLog
> testsuite/actionscript.all: Number.as
>
> Log message:
> * testsuite/actionscript.all/Number.as: more tests for
> Number()
> returning a primitive number rather then an object. I
> suspect
> most builtin functions will need to support both invocation
> as
> constructor *and* simple invocation.
>
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4329&r2=1.4330
> http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/Number.as?cvsroot=gnash&r1=1.29&r2=1.30
>
> Patches:
> Index: ChangeLog
> ===================================================================
> RCS file: /sources/gnash/gnash/ChangeLog,v
> retrieving revision 1.4329
> retrieving revision 1.4330
> diff -u -b -r1.4329 -r1.4330
> --- ChangeLog 16 Sep 2007 19:24:38 -0000 1.4329
> +++ ChangeLog 17 Sep 2007 05:55:37 -0000 1.4330
> @@ -1,5 +1,9 @@
> 2007-09-16 Sandro Santilli <address@hidden>
>
> + * testsuite/actionscript.all/Number.as: more tests for Number()
> + returning a primitive number rather then an object. I suspect
> + most builtin functions will need to support both invocation as
> + constructor *and* simple invocation.
> * testsuite/actionscript.all/ops.as: more tests for comparison between
> "different" nan values... :/
>
>
> Index: testsuite/actionscript.all/Number.as
> ===================================================================
> RCS file: /sources/gnash/gnash/testsuite/actionscript.all/Number.as,v
> retrieving revision 1.29
> retrieving revision 1.30
> diff -u -b -r1.29 -r1.30
> --- testsuite/actionscript.all/Number.as 11 Sep 2007 05:46:32 -0000
> 1.29
> +++ testsuite/actionscript.all/Number.as 17 Sep 2007 05:55:38 -0000
> 1.30
> @@ -27,11 +27,17 @@
> // TODO: test with SWF target != 6 (the only one tested so far)
> //
>
> -rcsid="$Id: Number.as,v 1.29 2007/09/11 05:46:32 zoulunkai Exp $";
> +rcsid="$Id: Number.as,v 1.30 2007/09/17 05:55:38 strk Exp $";
>
> #include "check.as"
>
> var n1=new Number(268);
> +check_equals(typeof(n1), 'object');
> +var n1prim = Number(268);
> +xcheck_equals(typeof(n1prim), 'number');
> +// gnash fails below because it compares 2 objects
> +// rather then an object and a primitive
> +xcheck_equals(n1, n1prim);
>
> // strict-equality operator was introduced in SWF6
> #if OUTPUT_VERSION > 5
>
>
> _______________________________________________
> Gnash-commit mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnash-commit
>