Bug 906375 - Bind all the methods in Console.jsm's console object (fixed patch). r=mratcliffe
authorDave Camp <dcamp@mozilla.com>
Sun, 18 Aug 2013 09:55:49 -0700
changeset 143042 5299795be54e4a90bc391740fad343352cd4260c
parent 143041 788a28f4b984014bbcc00db0e5e81b98bfa35dc0
child 143043 fa12065a2bb1ac67cb240e4695cdcd9a5d721e33
push id32605
push userphilringnalda@gmail.com
push dateMon, 19 Aug 2013 00:51:46 +0000
treeherdermozilla-inbound@7f882e063eaf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmratcliffe
bugs906375
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 906375 - Bind all the methods in Console.jsm's console object (fixed patch). r=mratcliffe
toolkit/devtools/Console.jsm
--- a/toolkit/devtools/Console.jsm
+++ b/toolkit/devtools/Console.jsm
@@ -584,19 +584,18 @@ function ConsoleAPI(aConsoleOptions = {}
   // Normalize console options to set default values
   // in order to avoid runtime checks on each console method call.
   this.dump = aConsoleOptions.dump || dump;
   this.prefix = aConsoleOptions.prefix || "";
   this.maxLogLevel = aConsoleOptions.maxLogLevel || "all";
 
   // Bind all the functions to this object.
   for (let prop in this) {
-    let desc = Object.getOwnPropertyDescriptor(this, prop);
-    if (typeof(desc.value) === "function") {
-      this[prop] = desc.value.bind(this);
+    if (typeof(this[prop]) === "function") {
+      this[prop] = this[prop].bind(this);
     }
   }
 }
 
 ConsoleAPI.prototype = {
   debug: createMultiLineDumper("debug"),
   log: createDumper("log"),
   info: createDumper("info"),