We often use createDelegate(this) in JavaScript so that the current object inside a function is the one where the function was declared. This is a peculiarity of JavaScript because this is not lexically obtained.
var that = this;
var callback = (function() {
assert this === that;
}).createDelegate(this);
In recent ECMAScript standard, this can be translated in the more readable arrow function.
var callback = () => {
assert this === that;
}
This might require #754 so we can get Babel support to transpile arrow functions on older browsers.
I noticed that this is an ExtJS-supplied feature, createDelegate is not a standard method, so it's added by editing the prototype of Function. Nevertheless, this workaround is not necessary.
We often use createDelegate(this) in JavaScript so that the current object inside a function is the one where the function was declared. This is a peculiarity of JavaScript because
this
is not lexically obtained.In recent ECMAScript standard, this can be translated in the more readable arrow function.
This might require #754 so we can get Babel support to transpile arrow functions on older browsers.