Skip to content

Commit

Permalink
fix: Again fixing default value printing
Browse files Browse the repository at this point in the history
  • Loading branch information
giann committed Jul 21, 2024
1 parent fcac4a1 commit 65d43ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/buzz_api.zig
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ fn valueDump(value: Value, vm: *VM, seen: *std.AutoHashMap(*_obj.Obj, void), dep

if (if (field.static)
object.fields[field.index]
else if (!field.method)
else if (field.has_default)
object.defaults[field.index]
else
null) |v|
Expand Down
8 changes: 7 additions & 1 deletion src/disassembler.zig
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,13 @@ pub const DumpState = struct {
},
) catch unreachable;

if (object.defaults[field.index]) |v| {
if (if (field.static)
object.fields[field.index]
else if (field.has_default)
object.defaults[field.index]
else
null) |v|
{
out.print(" = ", .{}) catch unreachable;
state.valueDump(
v,
Expand Down

0 comments on commit 65d43ec

Please sign in to comment.