Esfuzz
fuzzer for generative testing of ECMAScript parsers
Install / Use
/learn @estools/EsfuzzREADME
esfuzz
Fuzzer for generative testing of ECMAScript parsers, especially those that
implement the SpiderMonkey Reflect.parse API.
Install
npm install -g esfuzz
Usage
CLI
$ esfuzz --help
Usage: esfuzz OPT*
-n, --iterations NUM use at most NUM programs; default: unlimited
-d, --max-depth NUM create ASTs with a height no greater than NUM; default: 8
--acorn enable marijnh/acorn parser; default: on
--es6 allow ECMAScript 6 features in generated programs
--esprima enable ariya/esprima parser; default: on
--help display this help message and exit
--reflect enable Reflect.parse parser; default: on if it exists
--reflectjs enable zaach/reflect.js parser
--uglifyjs enable limited support for mishoo/UglifyJS2
--version display the version number and exit
--zeparser enable limited support for qfox/ZeParser
Module Interface
generate(options) -> SpiderMonkey_AST
Generate a random SpiderMonkey AST that represents a valid ECMAScript program. Available options:
maxDepth: create ASTs with a height no greater than this value
render(programAST, format) -> String (JS program)
Render a SpiderMonkey AST as an ECMAScript program. If the format argument is
omitted, a random format will be used. Otherwise, the given object must be in
the format of escodegen's format option.
fuzz(programAST, parsers) -> void
Takes a SpiderMonkey AST and a list of objects that have a parse method that
obeys the SpiderMonkey Reflect.parse API. This function will generate concrete
syntax and run it through each parser. If any of the parsers fail to parse the
program, an error will be thrown.
fuzzAndRoundtrip(programAST, parsers) -> void
Identical to fuzz, except additionally compares the outputs of each parser to
the generated program. If any of the parsers fail to parse the program or fail
to generate an AST equivalent to the given one, an error will be thrown.
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
