Permalink
Browse files

add support to jQuery.print for null and undefined

  • Loading branch information...
1 parent b76a0dd commit 86f1ec5d088e36cb8bed3dc2df8def2c51d41152 @tmm1 tmm1 committed May 4, 2008
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/jquery.print.js
View
8 lib/jquery.print.js
@@ -1,7 +1,13 @@
(function($) {
$.print = function(obj) {
+ if (typeof obj == 'undefined') {
+ return "undefined"
+
+ } else if (!obj) {
+ return "null"
+
// XXX in firefox, (function(){}) instanceof Function # => false
- if (obj instanceof Function) {
+ } else if (obj instanceof Function) {
return obj.toString().match(/^([^\{]*)\s{/)[1];
} else if (obj instanceof Array) {

0 comments on commit 86f1ec5

Please sign in to comment.