Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic on vimeo.com #26943

Merged
merged 1 commit into from Jun 17, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

dom: Avoid panic when SpiderMonkey enqueues dummy promise jobs.

  • Loading branch information
jdm committed Jun 16, 2020
commit 2e4cee99710a5745adf2bd1df185adcd36e5104f
@@ -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
@@ -14215,6 +14215,13 @@
{}
]
],
"promise-no-incumbent.html": [
"a5458d096b5da8d6619ef5c553f232261887f45a",
[
null,
{}
]
],
"promise.html": [
"5925047287175f291c07ee88075359ed92a86e6a",
[
@@ -0,0 +1,12 @@
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(function(t) {
let p = new Promise((r) => t.step_timeout(r, 0));
p.then = function() {};
let p2 = new Promise((r) => t.step_timeout(r, 10));
return Promise.race([p, p2]);
}, 'No panic when SM puts a dummy promise with no incumbent in the queue');
</script>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.