esfuzz
Version:
JS fuzzer for generative testing of parsers that implement the SpiderMonkey Reflect.parse API
43 lines (42 loc) • 1.33 kB
JavaScript
// Generated by CoffeeScript 2.0.0-beta7
void function () {
var cache$, construct, LHSExpression, Node, OPERATORS, randomBool, randomElement, UpdateExpression;
Node = require('../node');
LHSExpression = require('../classes/LHSExpression');
construct = require('../combinators').construct;
cache$ = require('../random');
randomBool = cache$.randomBool;
randomElement = cache$.randomElement;
OPERATORS = [
'++',
'--'
];
UpdateExpression = function (super$) {
extends$(UpdateExpression, super$);
UpdateExpression.prototype.type = UpdateExpression.name;
function UpdateExpression(depth, ancestors) {
--depth;
ancestors = [this].concat(ancestors);
this.operator = randomElement(OPERATORS);
this.argument = LHSExpression(depth, ancestors);
this.prefix = randomBool();
}
return UpdateExpression;
}(Node);
module.exports = construct(UpdateExpression);
function isOwn$(o, p) {
return {}.hasOwnProperty.call(o, p);
}
function extends$(child, parent) {
for (var key in parent)
if (isOwn$(parent, key))
child[key] = parent[key];
function ctor() {
this.constructor = child;
}
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}
}.call(this);