Skip to content

Commit

Permalink
Simplify .protect & unprotect (#16441)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner authored Jan 17, 2025
1 parent 348f5e9 commit ec11ea4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bun.js/bindings/bindings.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4322,12 +4322,12 @@ pub const JSValue = enum(i64) {
}

pub fn protect(this: JSValue) void {
if (this.isEmptyOrUndefinedOrNull() or this.isNumber()) return;
if (!this.isCell()) return;
JSC.C.JSValueProtect(JSC.VirtualMachine.get().global, this.asObjectRef());
}

pub fn unprotect(this: JSValue) void {
if (this.isEmptyOrUndefinedOrNull() or this.isNumber()) return;
if (!this.isCell()) return;
JSC.C.JSValueUnprotect(JSC.VirtualMachine.get().global, this.asObjectRef());
}

Expand Down

0 comments on commit ec11ea4

Please sign in to comment.