Simple example
console.log(this);
new Ext.Promise(function(resolve, reject){
resolve(123);
}).then(
function(v){
console.log(v);
console.log(this);
},
function(){},
function(){},
this
);
Result is:
constructor {compDomain: constructor, type: "patient", eventbus: constructor, $observableInitialized: true, hasListeners: HasListeners…}
123
Window {speechSynthesis: SpeechSynthesis, caches: CacheStorage, localStorage: Storage, sessionStorage: Storage, webkitStorageInfo: DeprecatedStorageInfo…}
Why last parameter of the 'then' function is not working?