[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: |
Sandro Santilli |
Subject: |
Re: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/Numb... |
Date: |
Mon, 17 Sep 2007 08:29:55 +0200 |
On Mon, Sep 17, 2007 at 02:26:13PM +0800, zou lunkai wrote:
> 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?
Yes, but in Gnash this only works for user-defined constructors, not for
built-ins
which are instead expected to return new objects (design failure).
There are TODOs here and there warning about this... in particular talking about
having built-ins and user-defined funx behave the same
--strk;