lydell / eslump

Fuzz testing JavaScript parsers and suchlike programs.
MIT License
57 stars 6 forks source link

Generate more `real-world` js code #13

Open sanex3339 opened 4 years ago

sanex3339 commented 4 years ago

This package is generating very random code that can be very synthetic. It will be nice to have an option that will produce more real-world js code.

For example:

I need this for fuzz testing of my package, that is working with the AST-tree, but currently, most of the code that is generated by eslump just break my package at the parse (espree)

lydell commented 4 years ago

Hi!

Good points!

FYI: This package is mostly a wrapper around shift-fuzzer.

valid strings and regexps

Aren’t the generated strings and regexps valid? Except this issue: https://github.com/shapesecurity/shift-fuzzer-js/issues/14

sanex3339 commented 4 years ago

I dont remember the exact regexps, but when i tried this package, the espree parse was failed on the most of the generated regexps

lydell commented 4 years ago

It could also mean that the regexps are valid but espree can’t parse them

aladdin-add commented 3 years ago

espree.parse() accept an option ecmaVersion - its defaults to 5.

maybe the generated regexps are valid, but not supported in ES5?