mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
js: Add option to disable quotes around strings
This commit is contained in:
parent
f46f9b0f02
commit
81e84c8273
Notes:
github-actions[bot]
2025-05-29 23:34:38 +00:00
Author: https://github.com/ananas-dev
Commit: 81e84c8273
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4915
Reviewed-by: https://github.com/trflynn89 ✅
3 changed files with 6 additions and 3 deletions
|
@ -1038,7 +1038,7 @@ ErrorOr<void> print_value(JS::PrintContext& print_context, JS::Value value, Hash
|
|||
else if (value.is_undefined())
|
||||
TRY(js_out(print_context, "\033[34;1m"));
|
||||
|
||||
if (value.is_string())
|
||||
if (value.is_string() && !print_context.disable_string_quotes)
|
||||
TRY(js_out(print_context, "\""));
|
||||
else if (value.is_negative_zero())
|
||||
TRY(js_out(print_context, "-"));
|
||||
|
@ -1049,7 +1049,7 @@ ErrorOr<void> print_value(JS::PrintContext& print_context, JS::Value value, Hash
|
|||
else
|
||||
TRY(js_out(print_context, "{}", contents));
|
||||
|
||||
if (value.is_string())
|
||||
if (value.is_string() && !print_context.disable_string_quotes)
|
||||
TRY(js_out(print_context, "\""));
|
||||
TRY(js_out(print_context, "\033[0m"));
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue