Bug Tracker

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#12199 closed bug (fixed)

$.isPlainObject false positive in IE < 9

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

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 (9)

comment:1 Changed 5 years 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 5 years ago by Rick Waldron

Component: unfiledcore
Owner: set to Rick Waldron
Priority: undecidedhigh
Status: newassigned

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

comment:3 Changed 5 years ago by Rick Waldron

Milestone: None1.9

comment:4 Changed 4 years ago by dmethvin

Milestone: 1.9None

comment:5 Changed 4 years ago by bjohn465

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

comment:6 Changed 4 years ago by gnarf

Owner: changed from Rick Waldron to bjohn465

comment:7 Changed 4 years ago by Rick Waldron

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

comment:8 Changed 4 years ago by dmethvin

Resolution: fixed
Status: assignedclosed

comment:9 Changed 4 years ago by dmethvin

Milestone: None1.10
Note: See TracTickets for help on using tickets.