mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
script: Return a Result from GlobalScope::evaluate_script_on_global_with_result (#38549)
Make GlobalScope::evaluate_script_on_global_with_result return a Result instead of a boolean. This is the first step to resolve issue #37810. Testing: Should not break or fix any existing tests --------- Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
This commit is contained in:
parent
86c37a380b
commit
4f8731d562
11 changed files with 45 additions and 28 deletions
|
@ -3738,7 +3738,7 @@ impl ScriptThread {
|
|||
// Script source is ready to be evaluated (11.)
|
||||
let _ac = enter_realm(global_scope);
|
||||
rooted!(in(*GlobalScope::get_cx()) let mut jsval = UndefinedValue());
|
||||
global_scope.evaluate_js_on_global_with_result(
|
||||
_ = global_scope.evaluate_js_on_global_with_result(
|
||||
&script_source,
|
||||
jsval.handle_mut(),
|
||||
ScriptFetchOptions::default_classic_script(global_scope),
|
||||
|
@ -4093,7 +4093,7 @@ impl ScriptThread {
|
|||
let context = window.get_cx();
|
||||
|
||||
rooted!(in(*context) let mut return_value = UndefinedValue());
|
||||
global_scope.evaluate_js_on_global_with_result(
|
||||
_ = global_scope.evaluate_js_on_global_with_result(
|
||||
&script,
|
||||
return_value.handle_mut(),
|
||||
ScriptFetchOptions::default_classic_script(global_scope),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue