gnash
[Top][All Lists]
Advanced

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

Re: [Gnash] Testcases for Gnash


From: strk
Subject: Re: [Gnash] Testcases for Gnash
Date: Thu, 9 Feb 2006 18:16:14 +0100

Thank you Nicolas. I'm trying to approach implementation
of INSTANCEOF support, so I have a few more questions
(mixed with quoted mail)

On Sat, Feb 04, 2006 at 11:59:16AM +0100, Nicolas Cannasse wrote:

> First in AS2 you can only implements interfaces (like Java). Interfaces 
> are generated as empty classes :
> 
> interface MyInterface {
>      function foo() : Void;
> }
> 
> is then equivalent to :
> 
> MyInterface = function() {
> }
> 
> The opcode [Implements] takes a list of interfaces and an AS2 "class" 
> (which is just an AS1 function) and adds theses interfaces to the list 
> of implemented classes. This list is not accessible from code 
> afterwards, but it's used by [InstanceOf] to check the heritance pattern.
> 
> Push [MyInterface]
> Push [1]; // number of interfaces on the stack
> Push [MyClass]
> Implements

Should there be a getVariable after the first and last push ?
I mean, will the stack contain strings or actual functions 
references ?

> As for [Extends], in AS1 you would write the following when inheriting :
> 
> MyClass.prototype.__proto__ = SuperClass.prototype;
> MyClass.prototype.__constructor__ = SuperClass;

Should this make (MyClass instanceOf SuperClass) evaluate to true ?

> While AS2 generates the following bytecode :
> 
> Push [SuperClass]
> Push [MyClass]
> Extends

Same question as above. Differences in player versions are good to know
(to take the compatibility issue into account).

> Which does all the prototype chaining for you.
> 
> Theses two opcodes are available starting from Player 6r89, so there is 
> nothing new in terms of virtual machine in players 7 and 8.

--strk;




reply via email to

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