Bug Tracker

Modify

Ticket #12199 (closed bug: fixed)

Opened 21 months ago

Last modified 13 months ago

$.isPlainObject false positive in IE < 9

Reported by: jdalton Owned by: bjohn465
Priority: high Milestone: 1.10
Component: core Version: 1.8rc1
Keywords: Cc:
Blocking: Blocked by:

Description

IE < 9 iterates over inherited properties before own properties which breaks the assumption in isPlainObject.

View the simple test case here (in IE < 9 and some other modern browser):  http://jsbin.com/ilulip

The last value logged to the page should be false but in IE < 9 it's true.

Change History

comment:1 Changed 21 months ago by jdalton

Here is Lo-Dash's isPlainObject implementation that avoids this issue:  https://github.com/bestiejs/lodash/blob/7520066fc916e205ef84cb97fbfe630d7c154158/lodash.js#L720-757

comment:2 Changed 21 months ago by rwaldron

  • Owner set to rwaldron
  • Priority changed from undecided to high
  • Status changed from new to assigned
  • Component changed from unfiled to core

Thanks for the heads up—I'll have a patch for you to review today

comment:3 Changed 19 months ago by rwaldron

  • Milestone changed from None to 1.9

comment:4 Changed 14 months ago by dmethvin

  • Milestone changed from 1.9 to None

comment:5 Changed 14 months ago by bjohn465

I put together a potential fix:  https://github.com/jquery/jquery/pull/1196

comment:6 Changed 14 months ago by gnarf

  • Owner changed from rwaldron to bjohn465

comment:7 Changed 14 months ago by rwaldron

Once the review changes are made, this will be ok by me

comment:8 Changed 13 months ago by dmethvin

  • Status changed from assigned to closed
  • Resolution set to fixed

comment:9 Changed 13 months ago by dmethvin

  • Milestone changed from None to 1.10

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.