Skip to content

CSS fixes - #16514

Merged
Jarred-Sumner merged 3 commits into
mainfrom
zack/more-css-fixes
Jan 19, 2025
Merged

CSS fixes#16514
Jarred-Sumner merged 3 commits into
mainfrom
zack/more-css-fixes

Conversation

@zackradisic

Copy link
Copy Markdown
Contributor

What does this PR do?

Add a lot more tests and fix a lot of stuff

@robobun

robobun commented Jan 19, 2025 •

Copy link
Copy Markdown
Collaborator
Updated 9:35 PM PT - Jan 18th, 2025

✅ @zackradisic, your commit 2057ea9 has passed in #10084! 🎉


🧪   try this PR locally:

bunx bun-pr 16514

Comment thread src/css/error.zig
var error_string = ArrayList(u8){};
defer error_string.deinit(allocator);
error_string.writer(allocator).print("{}", .{this.kind}) catch unreachable;
return bun.String.fromBytes(error_string.items).toJS(globalThis);

@Jarred-Sumner Jarred-Sumner Jan 19, 2025 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about:

pub fn toString(this: @This()) !bun.String {
   return try bun.String.createFormat("{}", .{this});
}

pub fn toJS(this: @This(), globalObject: *JSC.JSGlobalObject) !JSC.JSValue {
   var str = try this.toString();
   return str.transferToJS();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants