Bug Tracker

Modify

Ticket #7743 (closed bug: wontfix)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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.

Change History

comment:1 Changed 2 years ago by jaubourg

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.

comment:2 Changed 2 years ago by jaubourg

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

comment:3 Changed 2 years ago by jaubourg

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).

comment:4 Changed 2 years ago by cowboy

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

comment:5 Changed 2 years ago by dmethvin

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

comment:6 Changed 2 years ago by snover

  • Owner set to jaubourg
  • Status changed from new to pending

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

comment:7 Changed 2 years ago by jaubourg

  • Status changed from pending to new

@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.

comment:8 Changed 2 years ago by rwaldron

  • Status changed from new to closed
  • Resolution set to wontfix

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.