Skip to content

Commit f0c7eaa

Browse files
Merge pull request #62 from lightpanda-io/value_probes
Add more value probes.
2 parents 7d66883 + 3aa7909 commit f0c7eaa

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/binding.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,18 @@ bool v8__Value__IsFunction(const v8::Value& self) { return self.IsFunction(); }
757757

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

760+
bool v8__Value__IsBoolean(const v8::Value& self) { return self.IsBoolean(); }
761+
762+
bool v8__Value__IsBooleanObject(const v8::Value& self) { return self.IsBooleanObject(); }
763+
764+
bool v8__Value__IsInt32(const v8::Value& self) { return self.IsInt32(); }
765+
766+
bool v8__Value__IsUint32(const v8::Value& self) { return self.IsUint32(); }
767+
768+
bool v8__Value__IsNumber(const v8::Value& self) { return self.IsNumber(); }
769+
770+
bool v8__Value__IsNumberObject(const v8::Value& self) { return self.IsNumberObject(); }
771+
760772
bool v8__Value__IsObject(const v8::Value& self) { return self.IsObject(); }
761773

762774
bool v8__Value__IsString(const v8::Value& self) { return self.IsString(); }

src/binding.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,12 @@ void v8__Value__NumberValue(
401401
MaybeF64* out);
402402
bool v8__Value__IsFunction(const Value* self);
403403
bool v8__Value__IsAsyncFunction(const Value* self);
404+
bool v8__Value__IsBoolean(const Value* self);
405+
bool v8__Value__IsBooleanObject(const Value* self);
406+
bool v8__Value__IsInt32(const Value* self);
407+
bool v8__Value__IsUint32(const Value* self);
408+
bool v8__Value__IsNumber(const Value* self);
409+
bool v8__Value__IsNumberObject(const Value* self);
404410
bool v8__Value__IsObject(const Value* self);
405411
bool v8__Value__IsString(const Value* self);
406412
bool v8__Value__IsArray(const Value* self);

src/v8.zig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,6 +2037,30 @@ pub const Value = struct {
20372037
} else return error.JsException;
20382038
}
20392039

2040+
pub fn isBoolean(self: Self) bool {
2041+
return c.v8__Value__IsBoolean(self.handle);
2042+
}
2043+
2044+
pub fn isBooleanObject(self: Self) bool {
2045+
return c.v8__Value__IsBooleanObject(self.handle);
2046+
}
2047+
2048+
pub fn isNumber(self: Self) bool {
2049+
return c.v8__Value__IsNumber(self.handle);
2050+
}
2051+
2052+
pub fn isNumberObject(self: Self) bool {
2053+
return c.v8__Value__IsNumberObject(self.handle);
2054+
}
2055+
2056+
pub fn isInt32(self: Self) bool {
2057+
return c.v8__Value__IsInt32(self.handle);
2058+
}
2059+
2060+
pub fn isUint32(self: Self) bool {
2061+
return c.v8__Value__IsUint32(self.handle);
2062+
}
2063+
20402064
pub fn isObject(self: Self) bool {
20412065
return c.v8__Value__IsObject(self.handle);
20422066
}

0 commit comments

Comments
 (0)