[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] gnash ChangeLog server/asobj/Number.cpp testsui...
From: |
Sandro Santilli |
Subject: |
Re: [Gnash-commit] gnash ChangeLog server/asobj/Number.cpp testsui... |
Date: |
Mon, 26 Mar 2007 10:46:13 +0200 |
On Mon, Mar 26, 2007 at 10:20:06AM +0800, zou lunkai wrote:
> On 3/25/07, Sandro Santilli <address@hidden> wrote:
> >On Fri, Mar 23, 2007 at 05:47:13PM +0800, zou lunkai wrote:
> >> >>check_equals(typeof(Number.valueOf()), 'function'); // this is odd
> >> maybe a Ming bug?
> >
> >I think it makes sense looking at ECMA-262 specs:
> >The "primitive" value of a constructor is still a 'function'.
> >
> What's the "primitive" value mean here?
> >From ECMA-262, 4.3.2:
> A primitive value is member of one of the types Undefined, Null,
> Boolean, Number, or String.
It seems ActionScript (not completely ECMA-compatible) adds an 'object'
primitive, which is used when an object doesn't cast down to
any real primitive. I might be wrong, but I think we do have testcases
for this from swfdec too.
> 4.3.4:
> A constructor is a Function object that creates and initialises objects.
>
> >> typeof(Number.prototype.valueOf()) == undefined here!
> >
> >It's likely inherited from Function:
> >
> >Number.__proto__.valueOf()
> >
> This is illegal expression to me. And also Number.valueOf or
> Number.valueOf().
> The reason for this is that the "valueOf" is a property of
> Number.prototype(15.7.4.4). We can not access it directly. Notice that
> the Number constuctor does not have a "__proto__" property(15.7.3).
Weird, I tought Number was an instance of Function. Can you check this ?
> And with Ming compiler, the following results are confusing all together:
> trace(typeof(Number.valueOf())); //output: function;
> trace(typeof(Number.__proto__.valueOf())) //output: object;
> trace(typeof(Number.protoype.valueOf())); //output : undefined;
Are the results from the proprietary player or gnash ?
--strk;