From e4db7b6e9c23f356936527f0e0a5d195aee1a5d2 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 25 Mar 2016 09:05:52 +0100 Subject: [PATCH] Remove JS_SaveFrameChain and JS_RestoreFrameChain calls. They were cargo-culted from Gecko, where they haven't been necessary for a while either. --- components/script/dom/bindings/callback.rs | 11 ++--------- components/script/dom/bindings/error.rs | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/components/script/dom/bindings/callback.rs b/components/script/dom/bindings/callback.rs index dfd5966c04f..60da145dd42 100644 --- a/components/script/dom/bindings/callback.rs +++ b/components/script/dom/bindings/callback.rs @@ -13,7 +13,6 @@ use js::jsapi::{Heap, MutableHandleObject, RootedObject, RootedValue}; use js::jsapi::{IsCallable, JSContext, JSObject, JS_WrapObject}; use js::jsapi::{JSCompartment, JS_EnterCompartment, JS_LeaveCompartment}; use js::jsapi::{JS_GetProperty, JS_IsExceptionPending, JS_ReportPendingException}; -use js::jsapi::{JS_RestoreFrameChain, JS_SaveFrameChain}; use js::jsval::{JSVal, UndefinedValue}; use std::default::Default; use std::ffi::CString; @@ -197,14 +196,8 @@ impl Drop for CallSetup { if need_to_deal_with_exception { unsafe { let old_global = RootedObject::new(self.cx, self.exception_compartment.ptr); - let saved = JS_SaveFrameChain(self.cx); - { - let _ac = JSAutoCompartment::new(self.cx, old_global.ptr); - JS_ReportPendingException(self.cx); - } - if saved { - JS_RestoreFrameChain(self.cx); - } + let _ac = JSAutoCompartment::new(self.cx, old_global.ptr); + JS_ReportPendingException(self.cx); } } } diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index dafd14f58c9..a9ee93663e7 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -12,7 +12,6 @@ use js::error::{throw_range_error, throw_type_error}; use js::jsapi::JSAutoCompartment; use js::jsapi::{JSContext, JSObject, RootedValue}; use js::jsapi::{JS_IsExceptionPending, JS_ReportPendingException, JS_SetPendingException}; -use js::jsapi::{JS_RestoreFrameChain, JS_SaveFrameChain}; use js::jsval::UndefinedValue; /// DOM exceptions that can be thrown by a native DOM method. @@ -125,14 +124,8 @@ pub unsafe fn throw_dom_exception(cx: *mut JSContext, global: GlobalRef, result: pub fn report_pending_exception(cx: *mut JSContext, obj: *mut JSObject) { unsafe { if JS_IsExceptionPending(cx) { - let saved = JS_SaveFrameChain(cx); - { - let _ac = JSAutoCompartment::new(cx, obj); - JS_ReportPendingException(cx); - } - if saved { - JS_RestoreFrameChain(cx); - } + let _ac = JSAutoCompartment::new(cx, obj); + JS_ReportPendingException(cx); } } }