On Tue, May 3, 2011 at 8:58 AM, Stephan Beal <[email protected]> wrote:
> On Tue, May 3, 2011 at 8:56 AM, Mads Sig Ager <[email protected]> wrote: > >> On Tue, May 3, 2011 at 8:52 AM, Stephan Beal <[email protected]>wrote: >> >>> i think Charles is wanting to tie data to non-template-generated values >>> like Numbers. From what i understand, v8 does not have the API to do this. >>> Nor ... >>> >> > >> Object::GetIdentityHash should give you what you want to do the mapping >> externally. If you want to add external data after the fact in the object >> itself hidden values is the way to go. :) >> > > But Object::GetIdentityHash() only works for Objects, right? > > In SpiderMonkey each JS value is a numeric handle with a stable value (v8's > aren't stable b/c of how the allocator works), and those numbers can be used > to map, e.g. > a Window handle to a JS Integer. Yes, GetIdentifyHash only works for Objects. For values you can easily roll your own. What you get from GetIdentityHash will stay the same over time. -- Mads > > -- > ----- stephan beal > http://wanderinghorse.net/home/stephan/ > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
