It puts the symbol on the bound function, not the original.
<rdar://problem/25778133>
Created attachment 276638 [details] Patch
Comment on attachment 276638 [details] Patch r=me Could you include a short description of how to use this function? I had to go over to underscore.js to confirm what I thought was going on.
https://trac.webkit.org/changeset/199676
Comment on attachment 276638 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=276638&action=review > Source/WebInspectorUI/UserInterface/Base/Utilities.js:1210 > - let callback = this.bind(thisObject); > - return function() { > - clearTimeout(callback[debounceSymbol]); > + return () => { > + clearTimeout(this[debounceSymbol]); > + > let args = arguments; > - callback[debounceSymbol] = setTimeout(() => { > - callback.apply(null, args); > + this[debounceSymbol] = setTimeout(() => { > + this.apply(thisObject, args); > }, delay); > }; I don't think this works. Because the "arguments" here are not the correct arguments. Looking back at the original bug: https://bugs.webkit.org/show_bug.cgi?id=152655 Maybe this can be reduced to: value: function(delay, thisObject) { return (...args) => { clearTimeout(this[debounceSymbol]); this[debounceSymbol] = setTimeout(this.bind(thisObject), delay, ...args); } } We could add a unit-test for this.