Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate more real-world js code #13

Open
sanex3339 opened this issue Feb 6, 2020 · 4 comments
Open

Generate more real-world js code #13

sanex3339 opened this issue Feb 6, 2020 · 4 comments

Comments

@sanex3339
Copy link

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:

  • the variable should be declared before usage
  • valid strings and regexps
  • valid code structures: no use strict in the middle of code, only common patterns to organize the code

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
Copy link
Owner

lydell commented Feb 6, 2020

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: shapesecurity/shift-fuzzer-js#14

@sanex3339
Copy link
Author

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
Copy link
Owner

lydell commented Feb 6, 2020

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

@aladdin-add
Copy link
Contributor

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants