aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/modules/BufferModule.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/modules/BufferModule.h')
-rw-r--r--src/bun.js/modules/BufferModule.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bun.js/modules/BufferModule.h b/src/bun.js/modules/BufferModule.h
index 42eab5173..a96fb18c8 100644
--- a/src/bun.js/modules/BufferModule.h
+++ b/src/bun.js/modules/BufferModule.h
@@ -29,10 +29,13 @@ inline void generateBufferSourceCode(JSC::JSGlobalObject *lexicalGlobalObject,
JSC::JSObject *defaultObject = JSC::constructEmptyObject(
globalObject, globalObject->objectPrototype(), 12);
- defaultObject->putDirect(vm,
- PropertyName(Identifier::fromUid(
- vm.symbolRegistry().symbolForKey("CommonJS"_s))),
- jsNumber(0), 0);
+ auto CommonJS =
+ Identifier::fromUid(vm.symbolRegistry().symbolForKey("CommonJS"_s));
+
+ defaultObject->putDirect(vm, PropertyName(CommonJS), jsNumber(0), 0);
+
+ exportNames.append(CommonJS);
+ exportValues.append(jsNumber(0));
auto exportProperty = [&](JSC::Identifier name, JSC::JSValue value) {
exportNames.append(name);