Skip to main content

Bug Tracker

Side navigation

#5669 closed bug (fixed)

Opened December 16, 2009 06:02PM UTC

Closed December 18, 2009 05:19PM UTC

Last modified April 27, 2010 08:54AM UTC

isPlainObject( null/undefined/window ) on IE

Reported by: rkatic Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.4a1
Keywords: isPlanarObject Cc:
Blocked by: Blocking:
Description

On IE:

jQuery.isPlainObject( null );
// throws "'null.nodeType' is null or not an object"
jQuery.isPlainObject( undefined );
// throws "'undefined.nodeType' is null or not an object"
jQuery.isPlainObject( window );
// returns true

Patch

NOTE: With this patch isPlanarObject will work with windows too, until an global (window) constructor is not defined.

Attachments (0)
Change History (8)

Changed December 17, 2009 02:16AM UTC by dmethvin comment:1

description: On IE: \ {{{ \ jQuery.isPlanarObject( null ); \ // throws "'null.nodeType' is null or not an object" \ }}} \ {{{ \ jQuery.isPlanarObject( undefined ); \ // throws "'undefined.nodeType' is null or not an object" \ }}} \ {{{ \ jQuery.isPlanarObject( window ); \ // returns true \ }}} \ \ [http://github.com/rkatic/jquery/commit/44218409cc52ad83cd4e424dfd1201155967a1f8 Patch] \ NOTE: With this patch isPlanarObject will work with windows too, until an global (window) constructor is not defined.On IE: \ {{{ \ jQuery.isPlainObject( null ); \ // throws "'null.nodeType' is null or not an object" \ }}} \ {{{ \ jQuery.isPlainObject( undefined ); \ // throws "'undefined.nodeType' is null or not an object" \ }}} \ {{{ \ jQuery.isPlainObject( window ); \ // returns true \ }}} \ \ [http://github.com/rkatic/jquery/commit/44218409cc52ad83cd4e424dfd1201155967a1f8 Patch] \ NOTE: With this patch isPlanarObject will work with windows too, until an global (window) constructor is not defined.
summary: isPlanarObject( null/undefined/window ) on IEisPlainObject( null/undefined/window ) on IE

Corrected the spelling of the method name; the patch looks like a good idea.

Changed December 17, 2009 03:08AM UTC by rkatic comment:2

Replying to [comment:1 dmethvin]:

Corrected the spelling of the method name; the patch looks like a good idea.

Thanks, but there is still an isPlanarObject at the end (ups).

Too much 3D programming for this week I guess :).

Changed December 17, 2009 03:15AM UTC by rkatic comment:3

I made another mistake.

On first two cases (null and undefined), isPlainObjects returns true instead of throwing an error. Anyway the patch is fixing that.

Changed December 17, 2009 03:20AM UTC by rkatic comment:4

oops, ignore my last comment!

Changed December 18, 2009 04:41PM UTC by rkatic comment:5

Recommitted patch without unrelated files.

Patch

Changed December 18, 2009 05:19PM UTC by john comment:6

resolution: → fixed
status: newclosed

Changed December 19, 2009 12:37AM UTC by john comment:7

That commit wasn't enough. IE 8 was still failing so I landed some more checks:

http://github.com/jquery/jquery/commit/67b3be24e1215609cca524ee8158fc7e6e80db93

Changed April 27, 2010 08:54AM UTC by tswaters comment:8

This latest fix also resolves problems with passing certain ActiveX objects... specifically "Msxml2.XSLTemplate" -- see #6488