mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-08 11:24:11 +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 objproto = Object.prototype;
|
||||||
let hasOwnProperty = objproto.hasOwnProperty;
|
let hasOwnProperty = objproto.hasOwnProperty;
|
||||||
|
|
||||||
|
if (!XPCNativeWrapper.unwrap)
|
||||||
|
XPCNativeWrapper.unwrap = function (obj) {
|
||||||
|
if (hasOwnProperty.call(obj, "wrappedJSObject"))
|
||||||
|
return obj.wrappedJSObject;
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
if (!Object.create)
|
if (!Object.create)
|
||||||
Object.create = function (proto, props) {
|
Object.create = function (proto, props) {
|
||||||
let obj = { __proto__: proto };
|
let obj = { __proto__: proto };
|
||||||
|
|||||||
Reference in New Issue
Block a user