Skip to content
Browse files

add $.isWindow

  • Loading branch information...
1 parent af5533a commit e7e8416b79f6b0a8e4b730450c9f66b550b1d731 @mislav mislav committed Dec 23, 2012
Showing with 9 additions and 0 deletions.
  1. +1 −0 src/zepto.js
  2. +8 −0 test/zepto.html
View
1 src/zepto.js
@@ -269,6 +269,7 @@ var Zepto = (function() {
$.type = type
$.isFunction = isFunction
+ $.isWindow = isWindow
$.isArray = isArray
$.isPlainObject = isPlainObject
View
8 test/zepto.html
@@ -353,6 +353,14 @@
t.assertFalse($.isPlainObject(obj), 'function with prototype is not a plain object')
},
+ testIsWindow: function(t){
+ t.assertFalse($.isWindow())
+ t.assertFalse($.isWindow({}))
+ t.assertFalse($.isWindow(document.body))
+ t.assertTrue($.isWindow(window))
+ t.assertTrue($.isWindow($('iframe').get(0).contentWindow))
+ },
+
// test to see if we augment iOS 3.2 with String#trim()
testTrim: function(t){
t.assertEqual("blah", " blah ".trim())

0 comments on commit e7e8416

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