Skip to content

Commit dd47386

Browse files
Claude Botclaude
andcommitted
Fix console.log() with no arguments not printing newline
Changed ArgumentRequirement from Yes to No in logWithLevel so that console.log(), console.debug(), console.info(), console.warn(), and console.error() with no arguments will still call messageWithTypeAndLevel. This allows embedders like Bun to handle the empty argument case and print a newline, matching Node.js and browser behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 681cd50 commit dd47386

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/JavaScriptCore/runtime/ConsoleClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void ConsoleClient::internalMessageWithTypeAndLevel(MessageType type, MessageLev
261261

262262
void ConsoleClient::logWithLevel(JSGlobalObject* globalObject, Ref<ScriptArguments>&& arguments, MessageLevel level)
263263
{
264-
internalMessageWithTypeAndLevel(MessageType::Log, level, globalObject, WTF::move(arguments), ArgumentRequirement::Yes);
264+
internalMessageWithTypeAndLevel(MessageType::Log, level, globalObject, WTF::move(arguments), ArgumentRequirement::No);
265265
}
266266

267267
void ConsoleClient::clear(JSGlobalObject* globalObject)

0 commit comments

Comments
 (0)