Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use bun.String.static instead of ZigString when immediately converting to JSValue #14169

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

nektro
Copy link
Contributor

@nektro nektro commented Sep 25, 2024

thankfully this wasnt used as much as i was expecting but this should save all of these instances from having an unnecessary JSC.ZigString instance in .rodata as well as a ZigString.static generic instantiation in .text.

found with ZigString.static\("([^"]+)"\).toJS and ZigString.init\("([^"]+)"\).toJS
being replaced with bun.String.static("$1").toJS

future work: add support for this in the linter so new instances dont make their way in

@robobun
Copy link

robobun commented Sep 25, 2024

@nektro nektro marked this pull request as ready for review September 25, 2024 23:08
Copy link
Collaborator

@cirospaciari cirospaciari left a comment

Choose a reason for hiding this comment

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

LGTM lets merge after CI

@nektro nektro merged commit 54a2259 into main Oct 2, 2024
49 checks passed
@nektro nektro deleted the nektro-patch-54245 branch October 2, 2024 20:02
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