Bug 1196975 - part1: shimwaiver. r=billm
new file mode 100644
--- /dev/null
+++ b/toolkit/components/addoncompat/ShimWaiver.jsm
@@ -0,0 +1,15 @@
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+this.EXPORTED_SYMBOLS = ["ShimWaiver"];
+
+this.ShimWaiver = {
+ getProperty: function(obj, prop) {
+ let rv = obj[prop];
+ if (rv instanceof Function) {
+ rv = rv.bind(obj);
+ }
+ return rv;
+ }
+};
--- a/toolkit/components/addoncompat/moz.build
+++ b/toolkit/components/addoncompat/moz.build
@@ -12,9 +12,10 @@ EXTRA_COMPONENTS += [
'multiprocessShims.js',
]
EXTRA_JS_MODULES += [
'CompatWarning.jsm',
'Prefetcher.jsm',
'RemoteAddonsChild.jsm',
'RemoteAddonsParent.jsm',
+ 'ShimWaiver.jsm'
]