1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/ductwork/debugger/tests/head_dbg.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,17 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +"use strict"; 1.8 +const Cc = Components.classes; 1.9 +const Ci = Components.interfaces; 1.10 +const Cu = Components.utils; 1.11 +const Cr = Components.results; 1.12 + 1.13 +function testGlobal(aName) { 1.14 + let systemPrincipal = Cc["@mozilla.org/systemprincipal;1"] 1.15 + .createInstance(Ci.nsIPrincipal); 1.16 + 1.17 + let sandbox = Cu.Sandbox(systemPrincipal); 1.18 + Cu.evalInSandbox("this.__name = '" + aName + "'", sandbox); 1.19 + return sandbox; 1.20 +}