Skip to content
Browse files
Fix broken --useOSLog option.

Reviewed by Alexey Shvayka.

Internally, --useOSLog=0 is represented as OSLogType::None.  Options::dumpAllOptionsInALine()
dumps this value as "none".  When "none" is later passed back to Options::setOption(), it is
rejected because useOSLog's parse function wasn't expecting "none" as an input string.  The
fix is simply to add "none" to the list of allowed input strings.

Also, since OSLogType::None is a thing, it makes sense that the option should allow value
"none".  This issue was manifesting as a failure when running testapi.

* Source/JavaScriptCore/runtime/Options.cpp:

Canonical link:
git-svn-id: 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Mark Lam committed Jun 21, 2022
1 parent 97d96da commit daaa1b7
Showing 1 changed file with 1 addition and 1 deletion.
@@ -153,7 +153,7 @@ std::optional<OptionsStorage::OSLogType> parse(const char* string)
std::optional<OptionsStorage::OSLogType> result;

if (equalLettersIgnoringASCIICase(string, "false"_s) || !strcmp(string, "0"))
if (equalLettersIgnoringASCIICase(string, "none"_s) || equalLettersIgnoringASCIICase(string, "false"_s) || !strcmp(string, "0"))
result = OSLogType::None;
else if (equalLettersIgnoringASCIICase(string, "true"_s) || !strcmp(string, "1"))
result = OSLogType::Error;

0 comments on commit daaa1b7

Please sign in to comment.