diff options
author | sagudev <samo.golez@outlook.com> | 2021-03-13 12:56:41 +0100 |
---|---|---|
committer | sagudev <samo.golez@outlook.com> | 2021-03-13 12:56:41 +0100 |
commit | d424eaae91919e9e2653c5deb3069e4c00a2d1b3 (patch) | |
tree | 09eb37e43aa8be48fc1f3f428f9449dadc42b8e0 /components/script/script_module.rs | |
parent | a265a2a7e6c53eda558aa61712646382bbe129af (diff) | |
download | servo-d424eaae91919e9e2653c5deb3069e4c00a2d1b3.tar.gz servo-d424eaae91919e9e2653c5deb3069e4c00a2d1b3.zip |
Fix ModuleEvaluate
Diffstat (limited to 'components/script/script_module.rs')
-rw-r--r-- | components/script/script_module.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/script_module.rs b/components/script/script_module.rs index 9f2f2a2e506..5ae134cdcd9 100644 --- a/components/script/script_module.rs +++ b/components/script/script_module.rs @@ -52,7 +52,7 @@ use js::jsapi::{GetRequestedModules, SetModuleMetadataHook}; use js::jsapi::{Heap, JSContext, JS_ClearPendingException, SetModulePrivate}; use js::jsapi::{JSAutoRealm, JSObject, JSString}; use js::jsapi::{JS_DefineProperty4, JS_IsExceptionPending, JS_NewStringCopyN, JSPROP_ENUMERATE}; -use js::jsapi::{ModuleInstantiate, ThrowOnModuleEvaluationFailure}; +use js::jsapi::{ModuleInstantiate, ModuleEvaluate}; use js::jsval::{JSVal, PrivateValue, UndefinedValue}; use js::rust::jsapi_wrapped::{GetArrayLength, JS_GetElement}; use js::rust::jsapi_wrapped::{GetRequestedModuleSpecifier, JS_GetPendingException}; @@ -505,7 +505,8 @@ impl ModuleTree { let _ac = JSAutoRealm::new(*global.get_cx(), *global.reflector().get_jsobject()); unsafe { - if !ThrowOnModuleEvaluationFailure(*global.get_cx(), module_record) { + rooted!(in(*global.get_cx()) let mut rval = UndefinedValue()); + if !ModuleEvaluate(*global.get_cx(), module_record, rval.handle_mut().into()) { warn!("fail to evaluate module"); rooted!(in(*global.get_cx()) let mut exception = UndefinedValue()); |