- From: Zirro <notifications@github.com>
- Date: Fri, 23 Feb 2018 12:30:20 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 23 February 2018 20:30:50 UTC
DOMTokenList's `replace()`-method does not currently have a specified return value. While using it I've needed code which takes different paths depending on whether a successful replacement occurred or not. To find out if this was the case I must currently use separate conditions with `contains()`. Could `replace(oldToken, newToken)` return a boolean indicating true if oldToken was indeed present and got replaced by newToken? This would help with writing cleaner code, and there's a precent in the `toggle(token)`-method which returns true or false depending on whether the call resulted in the addition or removal of the token. Given the relatively recent introduction of `replace()`, there's probably a good chance of this change being web compatible. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/577
Received on Friday, 23 February 2018 20:30:50 UTC