1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 16:15:45 +01:00

Add reference counts for globally active style hives.

--HG--
branch : groups
This commit is contained in:
Kris Maglione
2011-02-08 20:53:11 -05:00
parent 9247244338
commit 863c10df7a
4 changed files with 59 additions and 18 deletions

View File

@@ -61,6 +61,8 @@ if (!Object.defineProperties)
for (let [k, v] in Iterator(props))
Object.defineProperty(obj, k, v);
}
if (!Object.freeze)
Object.freeze = function freeze(obj) {};
if (!Object.getOwnPropertyDescriptor)
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(obj, prop) {
if (!hasOwnProperty.call(obj, prop))
@@ -101,13 +103,15 @@ if (!Object.keys)
Object.keys = function keys(obj)
Object.getOwnPropertyNames(obj).filter(function (k) objproto.propertyIsEnumerable.call(obj, k));
let getGlobalForObject = Cu.getGlobalForObject || function (obj) obj.__parent__;
let use = {};
let loaded = {};
let currentModule;
let global = this;
function defineModule(name, params, module) {
if (!module)
module = Cu.getGlobalForObject ? Cu.getGlobalForObject(params) : params.__parent__;
module = getGlobalForObject(params);
module.NAME = name;
module.EXPORTED_SYMBOLS = params.exports || [];