From e16bef301530a2cb5ac02e548597362eac1674f5 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilev Date: Sun, 15 Jan 2023 22:04:30 +0800 Subject: [PATCH] cleanup --- tt.js | 63 ----------------------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 tt.js diff --git a/tt.js b/tt.js deleted file mode 100644 index 879eed0..0000000 --- a/tt.js +++ /dev/null @@ -1,63 +0,0 @@ -const x = async () => 1 - -const trace = fn => { - try { - const value = fn() - if(value instanceof Promise) { - return value - .then(v => { - value.status = {ok: true, value: v} - return v - }) - .catch(e => { - value.status = {ok: false, error: e} - throw e - }) - } else { - return value - } - } catch(e) { - - } finally { - } -} - -//trace(x) - -//const c = () => { -// return Promise.reject(1) -//} -// -//const b = () => { -// return c() -// .then(value => { -// console.log('v', value) -// return value -// }) -// .catch(e => { -// console.log('e') -// throw e -// }) -//} -// -// -//try { -// console.log(b()/*.catch(x => 1)*/) -//} catch(e) { -// console.log('error', e) -//} - -const throws_p = () => {throw Promise.reject('err')} - - -try { - await throws_p() -} catch(e) { - console.log('e', e) - try { - await e - } catch(e2) { - - console.log('e2', e2) - } -}