Bug Tracker

Modify

Ticket #7977 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

Changing the Object prototype breaks $.isEmptyObject

Reported by: ljharb@… Owned by: ljharb@…
Priority: low Milestone: 1.next
Component: core Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

If you change the Object prototype, $.isEmptyObject({}) will return false - and it should always return true for an empty object literal.

This is fixed in  https://github.com/jquery/jquery/pull/179

Change History

comment:1 Changed 3 years ago by rwaldron

  • Owner set to ljharb@…
  • Status changed from new to pending

Take a look at this guide  https://gist.github.com/672714

Please provide a reduced jsFiddle test case to help us assess your ticket!

Additionally, test against the latest jQuery release and the jQuery 0 GIT version to ensure the issue still exists.

comment:2 Changed 3 years ago by jitter

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from pending to closed
  • Component changed from unfiled to core

I can only restate what scott.gonzal already said 3 years ago

Modifying Object.prototype is an extremely bad practice. jQuery is not supported on any page where this occurs.

But you can follow the ticket mentioned below for progress on this issue.

comment:3 Changed 3 years ago by jitter

Duplicate of #2721.

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.