Skip to main content

Bug Tracker

Side navigation

#7743 closed bug (wontfix)

Opened December 10, 2010 03:08AM UTC

Closed December 14, 2010 08:26PM UTC

IE8: jQuery.isPlainObject( document.location ) throws an Invalid Pointer exception

Reported by: jaubourg Owned by: jaubourg
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

Found this one when the document.location test in test/unit/ajax.js failed.

jQuery.isPlainObject( document.location ) throws an Invalid Pointer exception in IE8. The inspector shows that document.location.constructor is an Invalid Pointer and as such cannot be accessed at all.

I suspect document.location is not the only variable with that issue so adding object !== document.location as a safeguard doesn't seem like an option.

Attachments (0)
Change History (8)

Changed December 10, 2010 03:23AM UTC by jaubourg comment:1

Seems it's even more complicated than this. See: http://jsfiddle.net/vZ6xf/

When you load the page, jQuery.isPlainObject( document.location ) returns true. When you click "Run", it throws an exception.

Probably something to do with the cache.

Gotta love IE.

Changed December 10, 2010 03:29AM UTC by jaubourg comment:2

So, in short, we could try/catch and return false, except the first time atound, it won't throw an exception and return true.

Changed December 10, 2010 04:00AM UTC by jaubourg comment:3

Ben Alman doesn't seem to have an exception thrown at him using an XP VM with IE 8.0.6001.18372. I'm using IE 8.0.6001.18975 on Vista (no VM).

Changed December 10, 2010 04:01AM UTC by cowboy comment:4

Also, FWIW, window.location or just location should be preferred to document.location.

Changed December 10, 2010 04:34AM UTC by dmethvin comment:5

IE 8.0.7600.16385 on Windows 7, alerts "true" both times with no crash.

Changed December 14, 2010 06:33AM UTC by snover comment:6

owner: → jaubourg
status: newpending

I’m not able to reproduce this issue. XP SP3 8.0.6001.18702. jaubourg, are you sure your IE is up to date?

Changed December 14, 2010 07:41AM UTC by jaubourg comment:7

status: pendingnew

@snover: like I said, 8.0.6001.18975. Vista does not propose any update.

Even if the crash is a temporary IE bug OR a Vista problem OR a jaubourg's Vista problem (who knows? ;) ), fact is it returns true for everybody else, which it shouldn't.

Changed December 14, 2010 08:26PM UTC by rwaldron comment:8

resolution: → wontfix
status: newclosed

There is a large issue with $.isPlainObject(), I'm closing this ticket. Please refer to #7780