Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,22 @@ IGNORE_GCC_WARNINGS_END

emitNewGenerator(m_generatorRegister);
bool isInternalPromise = false;
#if USE(BUN_JSC_ADDITIONS)
if (m_isBuiltinFunction) {
const auto isDefaultPromiseForBun = [&]() -> bool {
if (auto* provider = m_scopeNode->source().provider()) {
const String& sourceURL = provider->sourceURL();
if (!sourceURL.isNull() && !sourceURL.isEmpty())
return sourceURL == "node:fs/promises"_s;
}
return false;
};
isInternalPromise = !functionNode->ident().string().startsWith("defaultAsync"_s) && !isDefaultPromiseForBun();
}
#else
if (m_isBuiltinFunction)
isInternalPromise = !functionNode->ident().string().startsWith("defaultAsync"_s);
#endif
emitNewPromise(promiseRegister(), isInternalPromise);
emitPutInternalField(generatorRegister(), static_cast<unsigned>(JSGenerator::Field::Context), promiseRegister());
break;
Expand Down
Loading