Closed
Description
this is my first time trying to use await/promises
in a class constructor i put this:
if await new Promise (r) =>
cache.get @url, (b) =>
r b
return
return
then return
since that gave me error: Class constructor may not be async
when compiling i tried to work around it by wrapping it with do =>
:
do =>
if await new Promise (r) =>
cache.get @url, (b) =>
r b
return
return
then return
which throws at runtime with Uncaught SyntaxError: Unexpected token (
after async
i get the same result when adding a space after async
so my question is, what am i doing wrong?