[Pkg-mozext-commits] [greasemonkey] 02/35: GM_log truncates at NULL byte (typeof 'string' only) - the better solution

David Prévot taffit at moszumanska.debian.org
Wed May 20 02:43:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 61870329097ae157bf889e7da0011a73890b63a9
Author: janekptacijarabaci <janekptacijarabaci at users.noreply.github.com>
Date:   Thu Nov 6 10:38:14 2014 +0100

    GM_log truncates at NULL byte (typeof 'string' only) - the better solution
---
 modules/miscapis.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/miscapis.js b/modules/miscapis.js
index ebe1d94..f30fafc 100644
--- a/modules/miscapis.js
+++ b/modules/miscapis.js
@@ -244,9 +244,7 @@ GM_ScriptLogger.prototype.consoleService = Components
 
 GM_ScriptLogger.prototype.log = function(message) {
   // https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIConsoleService#logStringMessage() - wstring / wide string
-  if ('string' == typeof message || message instanceof String)
-    message = message.replace(/\0/g, '');
-  this.consoleService.logStringMessage(this.prefix + '\n' + message);
+  this.consoleService.logStringMessage((this.prefix + '\n' + message).replace(/\0/g, ''));
 };
 
 // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ //

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list