You can't pass raw externals into javascript. As you've notices that can easily cause v8 to crash (or, worse, not crash and then behave randomly). The only safe way to use an external is to store it in an internal field of an object and then pass the object into javascript. That has the added benefit of making it easy to add a toString.
-- Christian On Sat, Mar 7, 2009 at 4:15 PM, Stephan Beal <[email protected]> wrote: > > Hi, all! > > i'm making heavy use of v8::External to pass things around, and i'm > wondering if it's possible to somehow assign a new toString() > implementation to an External (which is-not-a Object)? Trying to print > (myExternalHandle) is currently crashing, and i'd like to return > something more useful than a segfault. > > :-? > > > --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
