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

improve Bun.stringWidth's algorithm #9022

Merged
merged 17 commits into from
Feb 23, 2024
Merged
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -82,4 +82,4 @@ url = https://github.com/litespeedtech/ls-hpack.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
fetchRecurseSubmodules = false
3 changes: 3 additions & 0 deletions src/bun.js/bindings/BunObject.cpp
Original file line number Diff line number Diff line change
@@ -675,6 +675,9 @@ class JSBunObject : public JSC::JSNonFinalObject {
auto structure = createStructure(vm, globalObject, globalObject->objectPrototype());
auto* object = new (NotNull, JSC::allocateCell<JSBunObject>(vm)) JSBunObject(vm, structure);
object->finishCreation(vm);
#ifdef BUN_DEBUG // move this to table above when all the tests in test/js/bun/util/stringWidth.test.ts pass
object->putDirectNativeFunction(vm, globalObject, Identifier::fromString(vm, "stringWidth"_s), 2, BunObject_callback_stringWidth, ImplementationVisibility::Public, NoIntrinsic, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::Function | 0);
#endif
return object;
}
};
Loading
Loading