I noticed that promise.js contains a custom implementation of the promise prototype which contains a then1 method. It looks like it is shorthand to call the regular then method with one instead of two parameters - is this intended for flow control to allow functions to continue in case a promise fails?
In general, are there any best practices on when and how to use then1 vs then?
Besides that, it seems like the custom function breaks the default js async functionality, e.g. I just stumbled over that issue when using the autotag framework. getArtwork is called by applyToTracks in searchCommon.js and the returned promise is then resolved via then1.
The getArtwork function in the same file looks like this
Code: Select all
getArtwork: function (searchManager, founds, list) {
return new Promise(function (resolve, reject) {
resolve(false);
});
},
Code: Select all
getArtwork: async function (searchManager, founds, list) {
[some magic here]
return true // or false, depending on the success of the lookup
}
Any pointers on how I could work with this issue?