fix: crash when request has no body

This commit is contained in:
Nicolas Lepage
2024-10-14 23:28:21 +02:00
parent 74cbaf89b5
commit 8abad8cb77
2 changed files with 25 additions and 11 deletions

View File

@@ -73,6 +73,14 @@ func (v Value) IndexString(i int) (string, error) {
return safejs.Value(sv).String()
}
func (v Value) IsNull() bool {
return safejs.Value(v).IsNull()
}
func (v Value) IsUndefined() bool {
return safejs.Value(v).IsUndefined()
}
func (v Value) New(args ...any) (Value, error) {
args = toJSValue(args).([]any)
r, err := safejs.Value(v).New(args...)