Skip to content
Browse files

Fix safeToString on primitives

safeToString(0) === "0", not "false"
safeToString(null) === "null", not "undefined"
  • Loading branch information...
1 parent f5c0cfc commit 361d48d759d8d59f4a0184685f06e90137dcaea3 @simonlindholm simonlindholm committed
Showing with 1 addition and 9 deletions.
  1. +1 −9 extension/content/firebug/lib/string.js
View
10 extension/content/firebug/lib/string.js
@@ -792,15 +792,7 @@ Str.safeToString = function(ob)
try
{
if (!ob)
- {
- if (ob == undefined)
- return "undefined";
- if (ob == null)
- return "null";
- if (ob == false)
- return "false";
- return "";
- }
+ return ""+ob;
if (ob && (typeof (ob["toString"]) == "function") )
return ob.toString();
if (ob && typeof (ob["toSource"]) == "function")

0 comments on commit 361d48d

Please sign in to comment.
Something went wrong with that request. Please try again.