Skip to content

Commit 0c7e648

Browse files
committed
add isPromise to Value
1 parent 23718cd commit 0c7e648

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/binding.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ bool v8__Value__IsFunction(const v8::Value& self) { return self.IsFunction(); }
865865

866866
bool v8__Value__IsAsyncFunction(const v8::Value& self) { return self.IsAsyncFunction(); }
867867

868+
bool v8__Value__IsPromise(const v8::Value& self) { return self.IsPromise(); }
869+
868870
bool v8__Value__IsBoolean(const v8::Value& self) { return self.IsBoolean(); }
869871

870872
bool v8__Value__IsBooleanObject(const v8::Value& self) { return self.IsBooleanObject(); }

src/binding.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ void v8__Value__NumberValue(
472472
MaybeF64* out);
473473
bool v8__Value__IsFunction(const Value* self);
474474
bool v8__Value__IsAsyncFunction(const Value* self);
475+
bool v8__Value__IsPromise(const Value* self);
475476
bool v8__Value__IsBoolean(const Value* self);
476477
bool v8__Value__IsBooleanObject(const Value* self);
477478
bool v8__Value__IsInt32(const Value* self);

src/v8.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,10 @@ pub const Value = struct {
21082108
return c.v8__Value__IsAsyncFunction(self.handle);
21092109
}
21102110

2111+
pub fn isPromise(self: Self) bool {
2112+
return c.v8__Value__IsPromise(self.handle);
2113+
}
2114+
21112115
pub fn isArray(self: Self) bool {
21122116
return c.v8__Value__IsArray(self.handle);
21132117
}

0 commit comments

Comments
 (0)