@@ -1004,7 +1004,7 @@ pub const ObjectTemplate = struct {
10041004 .enumerator = configuration .enumerator orelse null ,
10051005 .definer = configuration .definer orelse null ,
10061006 .descriptor = configuration .descriptor orelse null ,
1007- .data = if (@typeInfo (@TypeOf (data )) == .@" null" ) null else getDataHandle (data ),
1007+ .data = if (@typeInfo (@TypeOf (data )) == .null ) null else getDataHandle (data ),
10081008 .flags = configuration .flags ,
10091009 };
10101010 c .v8__ObjectTemplate__SetIndexedHandler (self .handle , & conf );
@@ -1019,7 +1019,7 @@ pub const ObjectTemplate = struct {
10191019 .enumerator = configuration .enumerator orelse null ,
10201020 .definer = configuration .definer orelse null ,
10211021 .descriptor = configuration .descriptor orelse null ,
1022- .data = if (@typeInfo (@TypeOf (data )) == .@" null" ) null else getDataHandle (data ),
1022+ .data = if (@typeInfo (@TypeOf (data )) == .null ) null else getDataHandle (data ),
10231023 .flags = configuration .flags ,
10241024 };
10251025 c .v8__ObjectTemplate__SetNamedHandler (self .handle , & conf );
@@ -1109,6 +1109,14 @@ pub const Object = struct {
11091109 return out .has_value ;
11101110 }
11111111
1112+ // Returns true on success, false on fail.
1113+ pub fn deleteValue (self : Self , ctx : Context , key : anytype ) bool {
1114+ var out : c.MaybeBool = undefined ;
1115+ c .v8__Object__Delete (self .handle , ctx .handle , getValueHandle (key ), & out );
1116+ // Set only returns empty for an error or true.
1117+ return out .has_value ;
1118+ }
1119+
11121120 pub fn setValueAtIndex (self : Self , ctx : Context , idx : u32 , value : anytype ) bool {
11131121 var out : c.MaybeBool = undefined ;
11141122 c .v8__Object__SetAtIndex (self .handle , ctx .handle , idx , getValueHandle (value ), & out );
0 commit comments