1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 let unprivilegedSb = new Cu.Sandbox('http://www.example.com');
7 function checkOpaqueWrapper(val) {
8 unprivilegedSb.prop = val;
10 Cu.evalInSandbox('prop();', sb);
12 Assert.ok(/denied|insecure|/.test(e));
15 let xoSb = new Cu.Sandbox('http://www.example.net');
16 let epSb = new Cu.Sandbox(['http://www.example.com']);
17 checkOpaqueWrapper(eval);
18 checkOpaqueWrapper(xoSb.eval);
19 checkOpaqueWrapper(epSb.eval);
20 checkOpaqueWrapper(Function);
21 checkOpaqueWrapper(xoSb.Function);
22 checkOpaqueWrapper(epSb.Function);