js-signals icon indicating copy to clipboard operation
js-signals copied to clipboard

_bindings.slice() in dispatch() method may not work as intended since slice() returns a shallow copy.

Open neochang opened this issue 7 years ago • 0 comments

In Signal.prototype.dispatch() method, there is the following line along with the comment:

bindings = this._bindings.slice(); //clone array in case add/remove items during dispatch

but since Array.slice() method returns a shallow copy, does that really work?

neochang avatar Dec 21 '17 07:12 neochang