diff options
author | 2023-10-10 15:28:08 -0700 | |
---|---|---|
committer | 2023-10-10 15:28:08 -0700 | |
commit | ee2e34866e3bc0d12ba5cb1d5041524776472d71 (patch) | |
tree | 3f71bf8153545396ba38294f8577e77ce0b12439 /src/bun.js/bindings/BunString.cpp | |
parent | e6d97f2581959d77a5b486faefbfdf094abedf9b (diff) | |
parent | 6301778a589254e2c3c0d95f768fce303f528b03 (diff) | |
download | bun-ee2e34866e3bc0d12ba5cb1d5041524776472d71.tar.gz bun-ee2e34866e3bc0d12ba5cb1d5041524776472d71.tar.zst bun-ee2e34866e3bc0d12ba5cb1d5041524776472d71.zip |
Merge branch 'main' into dylan/github-api-option
Diffstat (limited to 'src/bun.js/bindings/BunString.cpp')
-rw-r--r-- | src/bun.js/bindings/BunString.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bun.js/bindings/BunString.cpp b/src/bun.js/bindings/BunString.cpp index 31b331111..2db2694f3 100644 --- a/src/bun.js/bindings/BunString.cpp +++ b/src/bun.js/bindings/BunString.cpp @@ -9,6 +9,7 @@ #include <wtf/text/AtomString.h> using namespace JSC; +extern "C" BunString BunString__fromBytes(const char* bytes, size_t length); extern "C" bool Bun__WTFStringImpl__hasPrefix(const WTF::StringImpl* impl, const char* bytes, size_t length) { @@ -74,7 +75,10 @@ JSC::JSValue toJS(JSC::JSGlobalObject* globalObject, BunString bunString, size_t #endif return jsSubstring(globalObject, jsUndefined(), Bun::toWTFString(bunString), 0, length); } - +BunString toString(const char* bytes, size_t length) +{ + return BunString__fromBytes(bytes, length); +} WTF::String toWTFString(const BunString& bunString) { if (bunString.tag == BunStringTag::ZigString) { |