Bug 841067 - Use sandboxPrototype rather than __proto__ for marionette sandboxes. r=jgriffin

sandboxPrototype implements fancy rebinding behavior that makes things work right.
It is the "correct" mechanism to prototype a sandbox to a DOM Window.
This commit is contained in:
Bobby Holley 2013-02-14 10:40:15 +01:00
parent c1703b8bb3
commit 0c59e10db8

View File

@ -298,12 +298,11 @@ function resetValues() {
* Returns a content sandbox that can be used by the execute_foo functions.
*/
function createExecuteContentSandbox(aWindow, timeout) {
let sandbox = new Cu.Sandbox(aWindow);
let sandbox = new Cu.Sandbox(aWindow, {sandboxPrototype: aWindow});
sandbox.global = sandbox;
sandbox.window = aWindow;
sandbox.document = sandbox.window.document;
sandbox.navigator = sandbox.window.navigator;
sandbox.__proto__ = sandbox.window;
sandbox.testUtils = utils;
let marionette = new Marionette(this, aWindow, "content",