common: make Evented wrapper arguments into Array

This commit is contained in:
David Sevilla Martin 2020-02-23 09:35:59 -05:00
parent 241b8cc99c
commit fa47228b3f
No known key found for this signature in database
GPG Key ID: F764F1417E16B15F

View File

@ -51,8 +51,8 @@ export default class Evented {
* @param handler The function to handle the event.
*/
one(event: string, handler: EventHandler): this {
const wrapper = function() {
handler.apply(this, arguments);
const wrapper = function(this: Evented) {
handler.apply(this, Array.from(arguments));
this.off(event, wrapper);
};