diff options
author | 2023-01-27 22:55:46 -0800 | |
---|---|---|
committer | 2023-01-27 22:55:46 -0800 | |
commit | aff91436c0998b0368f0970fa0da42afa09640fc (patch) | |
tree | 5b906088b4143c4c4963454246181fb1bf0728d5 /src/bun.js/bindings/ZigGlobalObject.cpp | |
parent | 80751586390cd0c73fab9b5ff2e9d48b7df54719 (diff) | |
download | bun-aff91436c0998b0368f0970fa0da42afa09640fc.tar.gz bun-aff91436c0998b0368f0970fa0da42afa09640fc.tar.zst bun-aff91436c0998b0368f0970fa0da42afa09640fc.zip |
`Buffer.from` doesn't need to be the Buffer constructor
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 756cb359d..9f6a13b40 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -3172,7 +3172,11 @@ void GlobalObject::addBuiltinGlobals(JSC::VM& vm) putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "CloseEvent"_s), JSC::CustomGetterSetter::create(vm, JSCloseEvent_getter, nullptr), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly); - putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "Buffer"_s), JSC::CustomGetterSetter::create(vm, JSBuffer_getter, nullptr), + auto bufferAccessor = JSC::CustomGetterSetter::create(vm, JSBuffer_getter, nullptr); + + putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().BufferPublicName(), bufferAccessor, + JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly); + putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().BufferPrivateName(), bufferAccessor, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly); PUT_WEBCORE_GENERATED_CONSTRUCTOR("TextEncoder"_s, JSTextEncoder); |