gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Array class


From: strk
Subject: Re: [Gnash-dev] Array class
Date: Thu, 27 Apr 2006 18:37:46 +0200

On Thu, Apr 27, 2006 at 11:42:48AM +0200, strk wrote:

> Note that Gnash is currently unable to use such "proxy" members.
> When asked to print the 'length' member it prints it's value as
> <c_function 0x400e5100>. Rather, the 'length' memnber should point
> to a 'proxy' object, a kind of 'getter-setter'.
> Did anyone encounter a similar case by reading Gnash codebase ?

Ok, I committed in a patch to handle this situation.
Basically, rather then defining a new as_value type (which could
still be a good idea), I had the array_as_object class override
as_object::get_member and as_object::set_member. To make this
cleaner I changed the model by moving the current 'general'
implementations of these methods in as_object to protected
access level and being NOT virtual:

class as_object {
public:
        virtual get_member(...) { return get_member_default(...); }
        virtual set_member(...) { return set_member_default(...); }

protected:
        get_member_default(...);
        set_member_default(...);
}

Then, for array, we handle the case for 'lenght' or subscript
and fallback to call the *_default() version if failing.

I've also changed as_object from struct to class (altought I didn't
do any other access level change then the one explained above),
and classified array_as_object as well.

The array.swf test only fails for ActionScript class-statics.
I hope I'll have time to work on it sooner then later...

Reports of correctness of the already existing tests is
still appreciated (I uploaded another version with more care
to details).

--strk;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]