aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r--components/script/script_runtime.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs
index 02a6b42b854..284c49312c6 100644
--- a/components/script/script_runtime.rs
+++ b/components/script/script_runtime.rs
@@ -30,6 +30,7 @@ use crate::dom::promise::Promise;
use crate::dom::promiserejectionevent::PromiseRejectionEvent;
use crate::dom::response::Response;
use crate::microtask::{EnqueuedPromiseCallback, Microtask, MicrotaskQueue};
+use crate::script_module::EnsureModuleHooksInitialized;
use crate::script_thread::trace_thread;
use crate::task::TaskBox;
use crate::task_source::networking::NetworkingTaskSource;
@@ -498,6 +499,8 @@ unsafe fn new_rt_and_cx_with_parent(
SetJobQueue(cx, job_queue);
SetPromiseRejectionTrackerCallback(cx, Some(promise_rejection_tracker), ptr::null_mut());
+ EnsureModuleHooksInitialized(runtime.rt());
+
set_gc_zeal_options(cx);
// Enable or disable the JITs.
@@ -915,16 +918,13 @@ unsafe extern "C" fn consume_stream(
let mimetype = unwrapped_source.Headers().extract_mime_type();
//Step 2.3 If mimeType is not `application/wasm`, return with a TypeError and abort these substeps.
- match &mimetype[..] {
- b"application/wasm" | b"APPLICATION/wasm" | b"APPLICATION/WASM" => {},
- _ => {
- throw_dom_exception(
- cx,
- &global,
- Error::Type("Response has unsupported MIME type".to_string()),
- );
- return false;
- },
+ if !&mimetype[..].eq_ignore_ascii_case(b"application/wasm") {
+ throw_dom_exception(
+ cx,
+ &global,
+ Error::Type("Response has unsupported MIME type".to_string()),
+ );
+ return false;
}
//Step 2.4 If response is not CORS-same-origin, return with a TypeError and abort these substeps.