Skip to content

Commit

Permalink
Fixes #7400
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Dec 10, 2023
1 parent 54f1f46 commit 73b0426
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/bun.js/bindings/bindings.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3459,6 +3459,9 @@ pub const JSValue = enum(JSValueReprInt) {

return this.coerceToDouble(globalThis);
},
i64 => {
return this.coerceToInt64(globalThis);
},
i32 => {
if (this.isInt32()) {
return this.asInt32();
Expand Down
8 changes: 4 additions & 4 deletions src/bun.js/bindings/exports.zig
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,9 @@ pub const ZigConsoleClient = struct {
var opts = vals[1];
if (opts.isObject()) {
if (opts.get(global, "depth")) |depth_prop| {
if (depth_prop.isNumber())
print_options.max_depth = depth_prop.toU16();
if (depth_prop.isNull() or depth_prop.toInt64() == std.math.maxInt(i64))
if (depth_prop.isNumber() or depth_prop.isBigInt())
print_options.max_depth = depth_prop.toU16()
else if (depth_prop.isNull())
print_options.max_depth = std.math.maxInt(u16);
}
if (opts.get(global, "colors")) |colors_prop| {
Expand Down Expand Up @@ -2084,7 +2084,7 @@ pub const ZigConsoleClient = struct {
}
},
.Integer => {
const int = value.toInt64();
const int = value.coerce(i64, this.globalThis);
if (int < std.math.maxInt(u32)) {
var i = int;
const is_negative = i < 0;
Expand Down

0 comments on commit 73b0426

Please sign in to comment.