You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did not find this issue after searching in the issues tab for this repository.
about: deno gives a confusing error message when incorrectly declaring an arrow function.
example from REPL:
>(0)=>1Uncaught SyntaxError: Unexpectedtoken'<'
This can be extremely confusing in normal development because there is no < in the source code for the user to refer to.
Can be replicated with regular deno run as well as the REPL
Can be replicated when using a number, string, boolean, or null as the parameter
Can not be replicated when using an object as the parameter (e.g. Infinity, [], {}, undefined, etc. all successfully create an anonymous function)
Can be replicated when mixing object and non-object parameters (e.g. (1, undefined) => 0 replicates this)
Can not be replicated if the parameter is not wrapped in parenthesis (e.g. 0 => 1 gives back parse error: Expected ';', '}' or <eof>)
This appears to happen regardless of context. Attempting this with a non-arrow function results in a much more helpful error message. Browsers and tsc each give a different error message, and none of them mention < anywhere (browsers tried were chromium-edge and firefox).
Please let me know if this is the wrong bug report format or if this is the wrong place to submit this report, as this is my first issue report in a long time :)
The text was updated successfully, but these errors were encountered:
deno --version
:deno 1.43.5 (release, x86_64-pc-windows-msvc)
v8 12.4.254.13
typescript 5.4.5
I did not find this issue after searching in the issues tab for this repository.
about: deno gives a confusing error message when incorrectly declaring an arrow function.
example from REPL:
This can be extremely confusing in normal development because there is no
<
in the source code for the user to refer to.deno run
as well as the REPLnull
as the parameterInfinity
,[]
,{}
,undefined
, etc. all successfully create an anonymous function)(1, undefined) => 0
replicates this)parse error: Expected ';', '}' or <eof>
)This appears to happen regardless of context. Attempting this with a non-arrow function results in a much more helpful error message. Browsers and
tsc
each give a different error message, and none of them mention<
anywhere (browsers tried were chromium-edge and firefox).Please let me know if this is the wrong bug report format or if this is the wrong place to submit this report, as this is my first issue report in a long time :)
The text was updated successfully, but these errors were encountered: