deoptigate
deoptigate copied to clipboard
Breaks on filenames with backslashes
On Windows, filenames are delimited by backslashes. Unfortunately the CSV parser from v8-tools-core tries to parse them as \u0000 escapes when I believe it should be interpreting them verbatim.
This is the error I see when running on Windows:
$ deoptigate ./foo.js
deoptigate 🚫: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
Here's an example of what the log lines look like:
KeyedLoadIC,0x294d02d15a2,229,32,0,.,0x19619e869d9,C:\Users\abradley\Documents\Personal-dev\foo-bar\foo.js\x00,,
KeyedLoadIC,0x294d02cf7fd,509,35,0,.,0x19619e869d9,C:\Users\abradley\Documents\Personal-dev\foo-bar\foo.js,,
I'm not 100% sure this CSV parsing is the underlying issue, but it seems to be the culprit.
I had a first glance and note my thoughts :
- This issue is silent and not the
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object. - Maybe the TypeError could result of a similiar Unix/Windows problematic, but it concerns others paths in an another location.
To avoid this blocking error, I'd juste added a key !== null condition in the resolve-files.js > resolveAll function :
- The app can launch
- The listed keys are not the sames as the strings reformated in
csvparse.js > escapeFields
Furthermore, the app dont list any file to open at this state.
In view of the strings parsed in csvparse.js > escapeFields, this is probably due to the \u0000 issue you described.
@JGrimbert I don't want to steal this pull request from you ;) Will you be submitting one - I can otherwise.