This is not how Javascript works. There is no way to stage changes and only 
later commit them. Try-catch is not a transactional block.

On Monday, October 24, 2016 at 9:36:06 AM UTC+2, Jane Chen wrote:
>
> Embedding v8 5.3.  In my embedding application, the user can make some 
> updates and the updates are committed as one transaction when the script 
> exits.  When one statement throws an error which is caught by a try-catch 
> block, the scope of the try-catch block determines the aborted changes.  
> Here's an example:
>
> try {
>   update1();
>   update2();
> catch(err) {}
>
> In the above example, if update2 throws an exception, the changes made by 
> update1 should be aborted.
>
> In contrast, in the following script, if update2 throws an exception, the 
> changes made by update1 should be committed:
>
> update1();
> try {
>   update2();
> catch(err) {}
>
> Does v8 provide any way to register for user-specified try-catch blocks 
> for embedders to handle this use case?  I tried TryCatch.SetVerbose, but 
> apparently it's not meant for this.
>
> Thanks in advance.
>
>
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to