no need to capture req here

This commit is contained in:
Bruno Windels 2021-05-05 14:36:43 +02:00
parent d4d7adc7fc
commit 184480ad36

View file

@ -81,8 +81,9 @@ export function reqAsPromise(req) {
resolve(event.target.result);
needsSyncPromise && Promise._flush && Promise._flush();
});
req.addEventListener("error", () => {
reject(new IDBRequestError(req));
req.addEventListener("error", event => {
const error = new IDBRequestError(event.target);
reject(error);
needsSyncPromise && Promise._flush && Promise._flush();
});
});