estools / esfuzz Goto Github PK
View Code? Open in Web Editor NEWfuzzer for generative testing of ECMAScript parsers
License: BSD 3-Clause "New" or "Revised" License
fuzzer for generative testing of ECMAScript parsers
License: BSD 3-Clause "New" or "Revised" License
Now that ES6 is standardized, it would be awesome to be able to test tools by fuzzing ES6 code.
ref. #11
This will allow us to test zeparser and uglifyJS{,2}.
A shrinking function should take a node and produce a list of nodes that are potentially easier for a human to consume. A good strategy: generate the leaf, something around half the size, and something just barely smaller.
should be
break if ancestor.type is 'FunctionDeclaration'
This is legal:
a: function a() { a:; }
This is illegal:
a: !function a() { a:; }
It should allow us to use the same program for standard and nonstandard parsers. Also, it should expose program generation. Should we also expose a round-tripping helper?
Literal
can be a class, and we can have String
, Number
, etc. as nodes.
For this, we can use inh3/nPool.
I don't know why it didn't hit me earlier that this is the job for a monad. This should be pretty simple, remove tons of duplication for nodes that don't care about the above properties, and possibly make our generators more reusable/composable.
SpiderMonkey doesn't have setTimeout
/setImmediate
.
I appears to me that the fuzzer is biased towards rather small ast's.
Sometimes its nice to assure that the size is somehow "growing" (might be useful in quick check or quick check clones).
As such I propose adding a min_depth option
I obviously don't want to have global shared state, so I'll probably have to pass around a stack depth counter and have a fallback return value for each node if the counter is too high.
Hello,
How can I generate a test case using esfuzz so I can feed to the JS Parser?
Thanks in advance
These invalid RegExps were generated:
/([+-=_-M:2])+/
/[g--}]/
/([]|[+]|[z--o])/
/[W;?--gdH]+?/
/[p--y]/
/[$-$|-+?]/
/[$d--e]/
/[*x/A--T]/
/[P--C]/
/[E-w\\\\-?u]+?/
/[&-E--&{]/
/[7-Ww-&]/
/[+-:|-TeI>]/
/[(R7`h--`|]/
/[o--gu]*?/
/([dY--c])/
/([=-eX-?Yi])/
/[uT\\\\--rl]/
Why?
This will allow us to implement BreakStatement
/ ContinueStatement
/ ReturnStatement
/ LabeledStatement
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.