UNPKG

esfuzz

Version:

JS fuzzer for generative testing of parsers that implement the SpiderMonkey Reflect.parse API

47 lines (46 loc) 952 B
// Generated by CoffeeScript 2.0.0-beta7 void function () { var randomElement, randomInt, randomLineTerminator; exports.randomBool = function () { return Math.random() < .5; }; exports.randomInt = randomInt = function (max) { return Math.floor(Math.random() * (max + 1)); }; exports.randomElement = randomElement = function (list) { return list[randomInt(list.length - 1)]; }; exports.randomWhitespace = function () { return randomElement([ '\t', '\x0B', '\f', '\ufeff', ' ', '\xa0', '\u180e', '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', '\u2007', '\u2008', '\u2009', '\u200a', '\u202f', '\u205f', '\u3000' ]); }; randomLineTerminator = function () { return randomElement([ '\n', '\r', '\u2028', '\u2029' ]); }; }.call(this);