File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -331,6 +331,21 @@ pub const Env = struct {
331
331
};
332
332
}
333
333
334
+ pub fn waitTryCatch (
335
+ self : Env ,
336
+ alloc : std.mem.Allocator ,
337
+ ) anyerror ! JSResult {
338
+
339
+ // JS try cache
340
+ var try_catch : v8.TryCatch = undefined ;
341
+ try_catch .init (self .isolate );
342
+ defer try_catch .deinit ();
343
+
344
+ var res = JSResult {};
345
+ try self .wait (alloc , try_catch , & res );
346
+ return res ;
347
+ }
348
+
334
349
// run a JS script and wait for all callbacks
335
350
// try_catch + exec + wait
336
351
pub fn run (
Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ pub fn Env(
80
80
81
81
// TODO: check exec, wait who have v8 specific params
82
82
83
+ // waitTryCatch
84
+ assertDecl (T , "waitTryCatch" , fn (
85
+ self : T ,
86
+ alloc : std.mem.Allocator ,
87
+ ) anyerror ! JSResult_T );
88
+
83
89
// execTryCatch() executes script in JS
84
90
assertDecl (T , "execTryCatch" , fn (
85
91
self : T ,
You can’t perform that action at this time.
0 commit comments