lightspark-users team mailing list archive
-
lightspark-users team
-
Mailing list archive
-
Message #00055
Re: Global object/s
Hi,
it's needed to have multiple global objects as each script expects to
work on a clean context. For example each script may use initSlot.
Alessandro
Il giorno mar, 04/10/2011 alle 11.25 +0200, Matthias Gehre ha scritto:
> Hey,
>
> while looking through the code, I saw that in ABCContext::exec
> we create a global object for each script by
> global=Class<ASObject>::getInstanceS();
> and then do
> getGlobal()->registerGlobalScope(global);
> which adds the 'global' to the globalScopes member of GlobalObject.
>
> Why do we have multiple global scopes? It seems that
> GlobalObject::getVariableAndTargetByMultiname searches through all
> global objects,
> so it should be the same if we have just one instead of multiple?
>
> Then, I would derive GlobalObject from ASObject, as toString() on the
> global object should return "[object Global]".
> (we return [object Object] currently).
>
> Cheers,
> Matthias
>
Follow ups
References