Opened 5 years ago

Last modified 22 months ago

#18442 new defect

dom-prop doesn't call dojo/_base/connect::disconnect() when property that is assigned to function is replaced

Reported by: Michael J Van Sickle Owned by: Eugene Lazutkin
Priority: undecided Milestone: 1.14
Component: HTML Version: 1.10.3
Keywords: Cc:
Blocked By: Blocking:

Description

When a function is assigned to a node's property with dojo/dom-prop::set(), then it is tracked via an internal map that uses an attribute that is stored on the node to track it. By default, this is "dojoattrid". When a property is set to a function, then it appears that the code is looking to see if a previous function is being replaced and, if so, it calls dojo/_base/connect::disconnect() on it.

The bug is in the detection of the first function that is set in this way. Since the counter is initialized to "0", it evaluates to falsy when the code checks for an existing function key. As a result, disconnect is never called.

I believe that the counter should be intialized to "1" to avoid this issue.

ref: https://github.com/vansimke/dojo/blob/master/dom-prop.js#L160

Change History (6)

comment:1 Changed 5 years ago by bill

Component: GeneralHTML
Owner: set to Eugene Lazutkin

I guess that makes sense. I thought I saw you had added a test case for this in https://github.com/dojo/dojo/pull/131? So the test case is currently failing?

comment:2 Changed 5 years ago by Michael J Van Sickle

Yes, the test currently fails due to this bug.

comment:3 Changed 4 years ago by dylan

Milestone: tbd1.11

comment:4 Changed 4 years ago by dylan

Milestone: 1.111.12

Ok, after massive triage, ended up with about 80 tickets for 1.11 and 400 or so for 1.12. That's a bit unrealistic, so first I changed all 1.12 to 1.13 (with the plan to move some forward to the new 1.12. Now, I'm moving some of the 1.11 tickets that are less likely to get done this month without help to 1.11. Feel free to help out in January if you want to see this ticket land in 1.11.

comment:5 Changed 3 years ago by dylan

Milestone: 1.121.13

Ticket planning... move current 1.12 tickets out to 1.13 that likely won't get fixed in 1.12.

comment:6 Changed 22 months ago by dylan

Milestone: 1.131.14
Note: See TracTickets for help on using tickets.