]> git.donarmstrong.com Git - dactyl.git/blob - common/modules/bootstrap.jsm
Import r6923 from upstream hg supporting Firefox up to 22.0a1
[dactyl.git] / common / modules / bootstrap.jsm
1 // Copyright (c) 2011-2012 Kris Maglione <maglione.k@gmail.com>
2 //
3 // This work is licensed for reuse under an MIT license. Details are
4 // given in the LICENSE.txt file included with this file.
5 "use strict";
6
7 var EXPORTED_SYMBOLS = ["require"];
8
9 // Deal with cross-compartment XML passing issues.
10 function create(proto) Object.create(proto);
11 this["import"] = function import_(obj) {
12     let res = {};
13     for each (let key in Object.getOwnPropertyNames(obj))
14         Object.defineProperty(res, key, Object.getOwnPropertyDescriptor(obj, key));
15     return res;
16 }
17
18 // Deal with subScriptLoader prepending crap to loaded URLs
19 Components.utils.import("resource://gre/modules/Services.jsm");
20 function loadSubScript() Services.scriptloader.loadSubScript.apply(null, arguments);
21