Bug 1196975 - part1: shimwaiver. r=billm
authorGabor Krizsanits <gkrizsanits>
Fri, 09 Oct 2015 05:58:00 +0200
changeset 293021 44f249ecb0cd0075169607758e484df13fe5304d
parent 293020 a082d90d2732a7088f94b4dbacc1ea9b82c1c09a
child 293022 a4e71f016f2726fbd1aec892774c57f1577553f4
push id8824
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:18:56 +0000
treeherdermozilla-aurora@e2031358e2a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1196975
milestone45.0a1
Bug 1196975 - part1: shimwaiver. r=billm
toolkit/components/addoncompat/ShimWaiver.jsm
toolkit/components/addoncompat/moz.build
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'
 ]