[webkit-dev] ExecState::thisObject()

Maciej Stachowiak mjs at apple.com
Mon Jul 13 16:08:31 PDT 2009


On Jul 13, 2009, at 3:36 PM, Geoffrey Garen wrote:

>>> I discussed this a bit with Darin and Geoff, and we came to the  
>>> conclusion that the correct fix is to have each JS DOMObject store  
>>> a JSGlobalObject pointer and augment the toJS methods to pass a  
>>> global object instead of an ExecState (close to you #1).  I would  
>>> not advocate storing more data on the ExecState.
>
> Sam and I just noticed that, to fully support this behavior, any  
> host object that lazily constructs function properties using the  
> functions in lookup.h must either
>
> (a) change in the same way as DOM objects must change
>
> or
>
> (b) eagerly construct its function properties with the correct  
> prototype.
>
>
> Consider this case, which does not involve a DOM object:
>
> frames[0].Array.prototype.push.__proto__ ==  
> Array.prototype.push.__proto__

Built-in classes work somewhat differently. I believe they use the  
calling function's global object ("lexical global object") rather than  
having some notion of home object.

Regards,
Maciej



More information about the webkit-dev mailing list