[Pkg-mozext-commits] [firetray] 64/399: use TypeError() instead of custom cooking

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:23:14 UTC 2013


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

taffit pushed a commit to branch dfsg-clean
in repository firetray.

commit 64a7e2f65da9fa7fec91be81303bc4a505b2a5f1
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Mon Oct 3 10:44:17 2011 +0200

    use TypeError() instead of custom cooking
---
 src/modules/FiretrayIconLinux.jsm |    6 ++----
 src/modules/FiretrayMessaging.jsm |    2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/modules/FiretrayIconLinux.jsm b/src/modules/FiretrayIconLinux.jsm
index 79b3cd4..f0ef805 100644
--- a/src/modules/FiretrayIconLinux.jsm
+++ b/src/modules/FiretrayIconLinux.jsm
@@ -188,10 +188,8 @@ firetray.IconLinux = {
 
   setText: function(text, color) { // TODO: split into smaller functions;
     LOG("setText");
-    if (typeof(text) != "string" ) {
-      ERROR("'text' arguement must be toString()'d: ");
-      return false;
-    }
+    if (typeof(text) != "string" )
+      throw new TypeError();
 
     try {
       // build background from image
diff --git a/src/modules/FiretrayMessaging.jsm b/src/modules/FiretrayMessaging.jsm
index 81a4f61..e765d22 100644
--- a/src/modules/FiretrayMessaging.jsm
+++ b/src/modules/FiretrayMessaging.jsm
@@ -154,7 +154,7 @@ firetray.Messaging.Accounts = function(sortByTypeAndName) {
     return;
   }
   if (typeof(sortByTypeAndName) !== "boolean")
-    throw "sort arg must be a boolean";
+    throw new TypeError();
 
   this.sortByTypeAndName = sortByTypeAndName;
 };

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



More information about the Pkg-mozext-commits mailing list