From e261213b58e86fa9b328e738d73f322745700fc0 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Fri, 20 Jan 2017 14:39:39 +0100 Subject: [PATCH] Bug 1332378 - Worklet must evaluate scripts in the right JS compartment, r=nbp --- dom/worklet/Worklet.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/worklet/Worklet.cpp b/dom/worklet/Worklet.cpp index 7d5d77b7d410..e88af2d8755c 100644 --- a/dom/worklet/Worklet.cpp +++ b/dom/worklet/Worklet.cpp @@ -208,6 +208,8 @@ public: // since otherwise nsJSUtils::EvaluateString will set it up for us. compileOptions.setNoScriptRval(true); + JSAutoCompartment comp(cx, globalObj); + JS::Rooted unused(cx); if (!JS::Evaluate(cx, compileOptions, buffer, &unused)) { ErrorResult error;