mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibJS: Add missing internal object string printing for debugging
When testing with JS_BYTECODE_DEBUG macro defined or using the All_Debug profile, internal objects were not known in Value class to the function Value::to_string_without_side_effects leading to a VERIFICATION FAILED when running the test-js or test-web programs. Internal objects are known in the Value class as cells, and do not have a dedicated tag to identify them. Internal objects are detected using is_cell function call, but only after all other types have been checked as other types of non-internal objects can also be cells. Both the String and Utf16String version of the function were updated.
This commit is contained in:
parent
7260159b8f
commit
11dc254d27
Notes:
github-actions[bot]
2025-11-30 18:23:47 +00:00
Author: https://github.com/rcorsi
Commit: 11dc254d27
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6263
Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 0 deletions
|
|
@ -386,6 +386,8 @@ String Value::to_string_without_side_effects() const
|
|||
case EMPTY_TAG:
|
||||
return "<empty>"_string;
|
||||
default:
|
||||
if (is_cell())
|
||||
return String::formatted("[internal object {}]", as_cell().class_name()).release_value();
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
|
@ -417,6 +419,8 @@ Utf16String Value::to_utf16_string_without_side_effects() const
|
|||
case EMPTY_TAG:
|
||||
return "<empty>"_utf16;
|
||||
default:
|
||||
if (is_cell())
|
||||
return Utf16String::formatted("[internal object {}]", as_cell().class_name());
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue