-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Promises act odd when debugging in chrome #2286
Copy link
Copy link
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
When enabling Debug in chrome (simulator), using promises acts up for me.
var foo = {
bar () {
this.getLocation().then((loc) => {
console.log(loc);
});
},
getLocation () {
var p = new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(position => {
console.log('going to resolve');
resolve(position);
}, error => {
console.log('going to reject');
reject(error);
}, {
enableHighAccuracy: false,
timeout : 20000,
maximumAge : 15000
});
});
p.then(position => {
console.log('called in here');
return position;
});
return p;
},
};
foo.bar();Sometimes (when it has to look up the position because timeout has expired) I’m getting "going to resolve” logged but nothing else. No “called in here” and no loc in the method I’m calling this from.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.