certain bug: Illegal async arrow function parameter list
See original GitHub issueversion: 1.4.8 Snippet:
async function test(){
const someVar = null;
const done = async foo => {}
}
Throws Illegal async arrow function parameter list
(also reproducible in the REPL)
Observations: commenting out const someVar = null;
fixes the problem.
Can be found in the npm package electron-updater
right here node_modules/electron-updater/out/AppUpdater.js
Related issue: https://github.com/fuse-box/fuse-box/issues/1570
Being parsed without any issues with typescript
or babel or esprima
https://astexplorer.net/#/gist/3e1e685684c77a841dd4452b677654f9/6e25a2a530fc046e1dc55f5f3285fa7d5acd20d0
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
SyntaxError: Malformed formal parameter - JavaScript | MDN
The JavaScript exception "malformed formal parameter" occurs when the argument list of a Function() constructor call is invalid somehow.
Read more >Syntax for an async arrow function - javascript - Stack Overflow
Async arrow functions look like this for multiple arguments passed to it: const foo = async (evt, callback) => { // do something...
Read more >await in parameters · Issue #917 · tc39/ecma262 - GitHub
The grammar part seems a bit harder--suddenly, the grammar for async arrow function heads is not a subset of the grammar of CallExpression....
Read more >4483 - Feature Request: Support async/await functions - v8
an async arrow function in a subclass constructor before a super call has returned. ... Disallow 'yield' in async arrow parameter lists inside...
Read more >SyntaxError: Malformed formal parameter
The argument list is invalid somehow. Perhaps you accidentally picked a keyword like if or var as an argument name, or perhaps there's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@leeoniya @nchanged Parsed a lot of libraries now but couldn’t find any issues or “edge cases”. I added a bunch of new tests just to be sure. Even the Chinese language is very well supported 😃
@nchanged FYI. This bug was caused because of a mutual parser flag and validation against it. This flag have been replaced with a func arg
assignable
and validations against that arg instead. You can find it here. This means that this bug will never happen again, and everything related to it can’t happen either. So permanently solved 😃