mirror of
https://github.com/servo/servo.git
synced 2025-06-13 02:44:29 +00:00
dom: Avoid panic when SpiderMonkey enqueues dummy promise jobs.
This commit is contained in:
parent
a34d1573b6
commit
2e4cee9971
3 changed files with 25 additions and 1 deletions
|
@ -206,7 +206,12 @@ unsafe extern "C" fn enqueue_promise_job(
|
|||
let mut result = false;
|
||||
wrap_panic(&mut || {
|
||||
let microtask_queue = &*(extra as *const MicrotaskQueue);
|
||||
let global = GlobalScope::from_object(incumbent_global.get());
|
||||
let global = if !incumbent_global.is_null() {
|
||||
GlobalScope::from_object(incumbent_global.get())
|
||||
} else {
|
||||
let realm = AlreadyInRealm::assert_for_cx(cx);
|
||||
GlobalScope::from_context(*cx, InRealm::in_realm(&realm))
|
||||
};
|
||||
let pipeline = global.pipeline_id();
|
||||
let interaction = if promise.get().is_null() {
|
||||
PromiseUserInputEventHandlingState::DontCare
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue