[Pkg-mozext-commits] [tabmixplus] 05/30: Object.prototype.__noSuchMethod__ is obsolete since Firefox 39 - part 2
David Prévot
taffit at moszumanska.debian.org
Sun Jun 14 22:15:35 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit 68edd88899045542f205f8bfcad706e681e4afdf
Author: onemen <tabmix.onemen at gmail.com>
Date: Wed Mar 25 22:10:48 2015 +0200
Object.prototype.__noSuchMethod__ is obsolete since Firefox 39 - part 2
---
chrome/content/utils.js | 11 ++++++++++-
modules/LinkNodeUtils.jsm | 6 ------
modules/log.jsm | 10 +++++-----
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/chrome/content/utils.js b/chrome/content/utils.js
index cbe8010..27fe983 100644
--- a/chrome/content/utils.js
+++ b/chrome/content/utils.js
@@ -213,7 +213,7 @@ var Tabmix = { // jshint ignore:line
// console._removeInternal use this function name to remove it from
// caller list
- __noSuchMethod__: function TMP_console_wrapper(id, args) {
+ _getMethod: function TMP_console_wrapper(id, args) {
if (["changeCode", "setNewFunction", "nonStrictMode"].indexOf(id) > -1) {
this.installeChangecode();
return this[id].apply(this, args);
@@ -244,6 +244,15 @@ var Tabmix = { // jshint ignore:line
window.removeEventListener("unload", tabmix_destroy, false);
this.destroy();
}.bind(this), false);
+
+ var methods = ["changeCode", "setNewFunction", "nonStrictMode",
+ "getObject", "log", "getCallerNameByIndex", "callerName",
+ "isCallerInList", "obj", "assert", "trace"];
+ methods.forEach(function(id) {
+ this[id] = function TMP_console_wrapper() {
+ return this._getMethod(id, arguments);
+ };
+ }, this);
},
originalFunctions: {},
diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index cb2d13c..96e5b54 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -32,18 +32,12 @@ this.LinkNodeUtils = {
let doc = node.ownerDocument;
let wrapper = {
__tabmix: true,
- __noSuchMethod__: function(id) {
- TabmixSvc.console.log("Error " + id + " is not exist in wrappedNode", true);
- },
baseURI: node.baseURI,
host: node.host,
pathname: node.pathname,
className: node.className,
target: getTargetAttr(node.target, focusedWindow),
ownerDocument: {
- __noSuchMethod__: function(id) {
- TabmixSvc.console.log("Error ownerDocument." + id + " is not exist in wrappedNode", true);
- },
URL: doc.URL,
documentURI: doc.documentURI,
defaultView: {
diff --git a/modules/log.jsm b/modules/log.jsm
index 2ebaa10..364a8ea 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -85,12 +85,12 @@ this.console = {
} catch (ex) {this.assert(ex, "Error we can't show " + aMethod + " in Tabmix.show");}
},
- logStringMessage: function(aMessage) {
+ _logStringMessage: function(aMessage) {
Services.console.logStringMessage(aMessage.replace(/\r\n/g, "\n"));
},
clog: function(aMessage) {
- this.logStringMessage("TabMix :\n" + aMessage);
+ this._logStringMessage("TabMix :\n" + aMessage);
},
log: function TMP_console_log(aMessage, aShowCaller, offset) {
@@ -98,7 +98,7 @@ this.console = {
let names = this._getNames(aShowCaller ? 2 + offset : 1 + offset);
let callerName = names[offset+0];
let callerCallerName = aShowCaller && names[offset+1] ? " (caller was " + names[offset+1] + ")" : "";
- this.logStringMessage("TabMix " + callerName + callerCallerName + " :\n" + aMessage);
+ this._logStringMessage("TabMix " + callerName + callerCallerName + " :\n" + aMessage);
},
// get functions names from Error().stack
@@ -280,11 +280,11 @@ options = {
let location = aError.location ? "\n" + aError.location : "";
let assertionText = "Tabmix Plus ERROR" + errAt + ":\n" + (aMsg ? aMsg + "\n" : "") + aError.message + location;
let stackText = "\nStack Trace: \n" + this._formatStack(aError.stack.split("\n"));
- this.logStringMessage(assertionText + stackText);
+ this._logStringMessage(assertionText + stackText);
},
trace: function TMP_console_trace(aMsg) {
let stack = this._formatStack(this._getStackExcludingInternal());
- this.logStringMessage("Tabmix Trace: " + (aMsg || "") + '\n' + stack);
+ this._logStringMessage("Tabmix Trace: " + (aMsg || "") + '\n' + stack);
}
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list