The convention is to return the result of ThrowException, which is 
v8::Undefined.  The downside is that I have to pass back to the caller this 
information even though it's available hidden in the runtime.  I suppose I'm ok 
with that.


On Dec 2, 2010, at 4:58 AM, Stephan Beal wrote:

> On Thu, Dec 2, 2010 at 12:59 PM, Joshua Kifer <[email protected]> wrote:
>  v8::TryCatch tc;
>  v8::ThrowException(v8::Exception::Error(v8::String::New("test")));
>  printf("%d\n", tc.HasCaught());
> 
> prints 0
> 
> i believe the general convention is for the throwing function to return an 
> empty handle after calling ThrowException, and for the caller to check 
> whether the returned handle is empty. At least, that's how i've been doing 
> it, though i don't remember where i read that that was appropriate.
>  
> -- 
> ----- 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

Reply via email to