diff options
Diffstat (limited to 'src/bun.js/modules/BufferModule.h')
-rw-r--r-- | src/bun.js/modules/BufferModule.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bun.js/modules/BufferModule.h b/src/bun.js/modules/BufferModule.h index 12d4c54c8..9032f0d2e 100644 --- a/src/bun.js/modules/BufferModule.h +++ b/src/bun.js/modules/BufferModule.h @@ -1,4 +1,5 @@ #include "../bindings/ZigGlobalObject.h" +#include "../bindings/JSBuffer.h" #include "JavaScriptCore/JSGlobalObject.h" namespace Zig { @@ -10,6 +11,11 @@ inline void generateBufferSourceCode(JSC::JSGlobalObject* lexicalGlobalObject, J exportNames.append(JSC::Identifier::fromString(vm, "Buffer"_s)); exportValues.append(WebCore::JSBuffer::getConstructor(vm, globalObject)); + auto* slowBuffer = JSC::JSFunction::create(vm, globalObject, 0, "SlowBuffer"_s, WebCore::constructSlowBuffer, ImplementationVisibility::Public, NoIntrinsic, WebCore::constructSlowBuffer); + slowBuffer->putDirect(vm, vm.propertyNames->prototype, WebCore::JSBuffer::prototype(vm, *jsCast<JSDOMGlobalObject*>(lexicalGlobalObject)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete); + exportNames.append(JSC::Identifier::fromString(vm, "SlowBuffer"_s)); + exportValues.append(slowBuffer); + // substitute after JSBlob is implemented. exportNames.append(JSC::Identifier::fromString(vm, "Blob"_s)); exportValues.append(JSC::jsUndefined()); |