Closed davidfirst closed 7 years ago
An update: It seems like the Babylon's sourceType
parameter actually controls it. If it sets to script
, it does not force the 'strict mode'.
The PR I just opened fixes the hard-coded module
value of the sourceType
parameter, and as a result, fixes this issue as well.
Sorry about that! And good catch!
In some cases, the parser is not able to parse a file. Yet, it's very helpful to get the duplications report for other files.
An example: parsing a project with this line:
var mode = 0700
, throws an errorSyntaxError: Invalid number (46:30)
. The notation 0700 is actually in use, for instance here.Before yesterday's changes, it was able to process the project as the parser was Acorn-loose (error-tolerant parser). The current parser, Babylon, doesn't seem to have this option.
Maybe JSInspect can have a CLI option of tolerant mode, and when that option is enabled, it'll continue to parse other files and ignore the failing ones (or emit an 'error' event with the parser's error message). What do you think?