Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#5669 closed bug (fixed)

isPlainObject( null/undefined/window ) on IE

Reported by: Robert Katić Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.4a1
Keywords: isPlanarObject Cc:
Blocked by: Blocking:

Description (last modified by dmethvin)

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.

Change History (8)

comment:1 Changed 10 years ago by dmethvin

Description: modified (diff)
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.

comment:2 in reply to:  1 Changed 10 years ago by Robert Katić

Replying to 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 :).

comment:3 Changed 10 years ago by Robert Katić

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.

comment:4 Changed 10 years ago by Robert Katić

oops, ignore my last comment!

comment:5 Changed 10 years ago by Robert Katić

Recommitted patch without unrelated files.

Patch

comment:6 Changed 10 years ago by john

Resolution: fixed
Status: newclosed

comment:7 Changed 10 years ago by john

That commit wasn't enough. IE 8 was still failing so I landed some more checks: http://github.com/jquery/jquery/commit/67b3be24e1215609cca524ee8158fc7e6e80db93

comment:8 Changed 10 years ago by tswaters

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

Note: See TracTickets for help on using tickets.