From ca31b2d749386366986a7b0baa6a5d639f8561c3 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 16 Sep 2015 07:06:12 +0530 Subject: [PATCH] Add preserveWrapperCallback (fixes #7218) --- components/script/script_task.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/script/script_task.rs b/components/script/script_task.rs index d8ac155b3b9..96ff1a751eb 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -55,6 +55,7 @@ use js::jsapi::{DisableIncrementalGC, JS_AddExtraGCRootsTracer, JS_SetWrapObject use js::jsapi::{GCDescription, GCProgress, JSGCInvocationKind, SetGCSliceCallback}; use js::jsapi::{JSAutoRequest, JSGCStatus, JS_GetRuntime, JS_SetGCCallback, SetDOMCallbacks}; use js::jsapi::{JSContext, JSRuntime, JSTracer}; +use js::jsapi::{JSObject, SetPreserveWrapperCallback}; use js::jsval::UndefinedValue; use js::rust::Runtime; use layout_interface::{ReflowQueryType}; @@ -654,8 +655,10 @@ impl ScriptTask { } unsafe { + unsafe extern "C" fn empty_wrapper_callback(_: *mut JSContext, _: *mut JSObject) -> u8 { 1 } SetDOMProxyInformation(ptr::null(), 0, Some(shadow_check_callback)); SetDOMCallbacks(runtime.rt(), &DOM_CALLBACKS); + SetPreserveWrapperCallback(runtime.rt(), Some(empty_wrapper_callback)); // Pre barriers aren't working correctly at the moment DisableIncrementalGC(runtime.rt()); }