mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
Bug 906375 - Bind all the methods in Console.jsm's console object. r=mratcliffe
This commit is contained in:
parent
c7c7176adb
commit
a01c5c7e8c
@ -586,6 +586,14 @@ function ConsoleAPI(aConsoleOptions = {}) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConsoleAPI.prototype = {
|
||||
|
Loading…
Reference in New Issue
Block a user