Keep babel class as `this` when using a member function in `setTimeout`
问题 I have an ES2015 class, call it Foo , which has at least two member functions, bar and baz . In bar there is a call to setTimeout whose first parameter is this.baz . Works fine up to here, I inspected it in the debugger, and this does refer to the instance of my class. (Actually since I'm using babel, I end up with a _this = this substitution beforehand but anyway the right thing is being passed into the setTimeout , confirmed.) The problem is when the setTimeout callback fires, it calls the