I am not sure if this is just down to lwc running in strict mode, but when I call the methods below they are rejected with this error.
Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.invokeGetter
// create promises to fetch data from server
var promise1 = new Promise($A.getCallback(function(resolve, reject) {
helper.method1(component, helper);
if (reject) {
reject(reject);
} else {
resolve(resolve);
}
}));
var promise2 = new Promise($A.getCallback(function(resolve, reject) {
helper.method2(component, helper);
if (reject) {
reject(reject);
} else {
resolve(resolve);
}
}));
Promise.all([promise1, promise2])
.then(function(results) {
console.log("Success: " + results);
})
.catch(function(error) {
console.log("promise1: ", promise1);
console.log("promise2: ", promise2);
});
This may not be down to strict mode, but this is just what I found online, so any help or knowledge would be appreciated.