mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS: Add side-effect-free version of Value::to_string()
There are now two API's on Value: - Value::to_string(Interpreter&) -- may throw. - Value::to_string_without_side_effects() -- will never throw. These are some pretty big sweeping changes, so it's possible that I did some part the wrong way. We'll work it out as we go. :^) Fixes #2123.
This commit is contained in:
parent
d8aa2a6997
commit
c6ddbd1f3e
Notes:
sideshowbarker
2024-07-19 06:38:07 +09:00
Author: https://github.com/awesomekling
Commit: c6ddbd1f3e
25 changed files with 285 additions and 112 deletions
|
@ -76,7 +76,10 @@ JS::Value HTMLCanvasElementWrapper::get_context(JS::Interpreter& interpreter)
|
|||
return {};
|
||||
auto& arguments = interpreter.call_frame().arguments;
|
||||
if (arguments.size() >= 1) {
|
||||
auto* context = impl->get_context(arguments[0].to_string());
|
||||
auto string = arguments[0].to_string(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
auto* context = impl->get_context(string);
|
||||
return wrap(interpreter.heap(), *context);
|
||||
}
|
||||
return JS::js_undefined();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue