Reactime icon indicating copy to clipboard operation
Reactime copied to clipboard

False parsing of ArrayPattern

Open anilanar opened this issue 5 years ago • 3 comments

https://github.com/open-source-labs/reactime/blob/37ae68c5615f44a977fb08137adedf709b472353/src/backend/helpers.ts#L107-L114

The above code breaks for the following case:

const [, setState] = useFoo();

because hook.id.elements[0] is null with the above pattern match. hook.name will crash.

anilanar avatar Oct 28 '20 10:10 anilanar

Hi @anilanar,

Thanks for bringing this to our attention, we are looking into it.

Could you possibly link to the repo where you're having this issue?

Thanks!

rtviner avatar Dec 11 '20 04:12 rtviner

@rtviner I cannot. If const [, setState] = useFoo(); is not reproducable, feel free to close.

anilanar avatar Jan 20 '21 10:01 anilanar

This should be easy to fix. See https://github.com/open-source-labs/reactime/pull/261 for a fix for a similar issue in the same part of the code.

aspiers avatar Dec 11 '21 21:12 aspiers

Already found a fix in a prior branch and merged in from a prior contributor see #261 thread

jemzir avatar Jan 05 '23 17:01 jemzir