diff options
Diffstat (limited to 'src/bun.js/modules/TTYModule.h')
-rw-r--r-- | src/bun.js/modules/TTYModule.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bun.js/modules/TTYModule.h b/src/bun.js/modules/TTYModule.h index 423268b32..79bc8c871 100644 --- a/src/bun.js/modules/TTYModule.h +++ b/src/bun.js/modules/TTYModule.h @@ -62,17 +62,20 @@ inline void generateTTYSourceCode(JSC::JSGlobalObject *lexicalGlobalObject, tty->putDirect(vm, JSC::Identifier::fromString(vm, "WriteStream"_s), notimpl); exportValues.append(notimpl); - tty->putDirect(vm, - PropertyName(Identifier::fromUid( - vm.symbolRegistry().symbolForKey("CommonJS"_s))), - jsNumber(0), 0); - for (size_t i = 0; i < exportNames.size(); i++) { tty->putDirect(vm, exportNames[i], exportValues.at(i), 0); } exportNames.append(vm.propertyNames->defaultKeyword); exportValues.append(tty); + + auto CommonJS = + Identifier::fromUid(vm.symbolRegistry().symbolForKey("CommonJS"_s)); + + exportNames.append(CommonJS); + exportValues.append(jsNumber(0)); + + tty->putDirect(vm, PropertyName(CommonJS), jsNumber(0), 0); } } // namespace Zig |