mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-31 15:32:27 +01:00
Provide XPCNativeWrapper.unwrap if it doesn't exist. Closes issue #38.
This commit is contained in:
@@ -14,6 +14,12 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
let objproto = Object.prototype;
|
||||
let hasOwnProperty = objproto.hasOwnProperty;
|
||||
|
||||
if (!XPCNativeWrapper.unwrap)
|
||||
XPCNativeWrapper.unwrap = function (obj) {
|
||||
if (hasOwnProperty.call(obj, "wrappedJSObject"))
|
||||
return obj.wrappedJSObject;
|
||||
return obj;
|
||||
}
|
||||
if (!Object.create)
|
||||
Object.create = function (proto, props) {
|
||||
let obj = { __proto__: proto };
|
||||
|
||||
Reference in New Issue
Block a user