Bug Tracker

Opened 5 years ago

Closed 5 years ago

#14684 closed bug (notabug)

Data creates new object

Reported by: holdenru@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.2
Keywords: Cc:
Blocked by: Blocking:

Description

http://jsfiddle.net/holden321/Pruj2/

var a={};
$(document).data(a);
console.log(a==$(document).data()); // returns false, expected: true, BUG?!

var a={};
$(document).data({a:a});
console.log(a==$(document).data('a')); // returns true, expected: true, OK

Change History (1)

comment:1 Changed 5 years ago by scottgonzalez

Resolution: notabug
Status: newclosed

There is no API for setting the entirety of the data. You're using an API for setting multiple individual properties, of which you're setting none.

Note: See TracTickets for help on using tickets.