Whole file
terryyin/lizard
The author described this change as “Fix async unparenthesized arrow corrupting parser state in class bodies”. It counts as a record because the check below fails on the code as it stood at ad7ef2f83 and passes on 57e1ac296, with nothing else changed between the two runs.
Projectterryyin/lizard
Fix saved2026-04-22
Sharing licenceMIT · LICENSE.txt
Change size+5 −1
What the code was meant to do, written into the code itself as a save note
Fix async unparenthesized arrow corrupting parser state in class bodies
The change
| 277 | 277 | self.next(self._function, token) | |
| 278 | 278 | return | |
| 279 | 279 | # If we've seen async/static and this is an identifier, it's likely a method name | |
| 280 | - | elif (self._async_seen or self._static_seen) and token not in ('*', 'function'): | |
| 280 | + | elif (self._async_seen or self._static_seen) and token not in ('*', 'function', '=>'): | |
| 281 | 281 | if token == '=': | |
| 282 | 282 | # End of static/async field name — clear modifiers so | |
| 283 | 283 | # the value expression and subsequent members parse | |
| ⋯ | |||
| 415 | 415 | self._push_function_to_stack() | |
| 416 | 416 | # Clear function_name so expression-body ( doesn't re-enter _function | |
| 417 | 417 | self.function_name = '' | |
| 418 | + | # Clear modifiers so the body's opening { isn't captured by the | |
| 419 | + | # async/static handler in the class body path. | |
| 420 | + | self._async_seen = False | |
| 421 | + | self._static_seen = False | |
| 418 | 422 | self.next(self._state_global, token) | |
| 419 | 423 | ||
| 420 | 424 | def _function(self, token): | |
The check that tells the two apart
fail→pass·test/test_languages/testES6.py::Test_ES6_unparenthesized_arrow_params::test_async_unparenthesized_arrow_complex_body
Check file test/test_languages/testES6.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itad7ef2f83ccc06b53be84e585ed047dd5a2a636d
Broken version dated2026-04-22
Modulelizard_languages.typescript
Units changedTypeScriptStates
Fingerprinta3780d1dd1482706
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in terryyin/lizard
- 2026-08-08fix(java): do not report control structures as methods
- 2026-07-02HalsteadClassifier
- 2026-07-02fix(csv): emit columns for extensions with multiple FUNCTION_INFO fields
- 2026-06-15fix(golike): register generic functions with [...] type params
- 2026-06-15fix(java): enhance parsing of generic and qualified type names in anonymous classes
- 2026-06-11fix(script): stop a '#' comment continuing past a trailing backslash (#317)