esfuzz
Version:
JS fuzzer for generative testing of parsers that implement the SpiderMonkey Reflect.parse API
44 lines (43 loc) • 1.54 kB
JavaScript
// Generated by CoffeeScript 2.0.0-beta7
void function () {
var BlockStatement, cache$, construct, FunctionDeclaration, Identifier, listOf, Node, Pattern;
Node = require('../node');
Pattern = require('../classes/Pattern');
BlockStatement = require('./BlockStatement');
Identifier = require('./Identifier');
cache$ = require('../combinators');
construct = cache$.construct;
listOf = cache$.listOf;
FunctionDeclaration = function (super$) {
extends$(FunctionDeclaration, super$);
FunctionDeclaration.prototype.type = FunctionDeclaration.name;
FunctionDeclaration.prototype.defaults = [];
FunctionDeclaration.prototype.rest = null;
FunctionDeclaration.prototype.generator = false;
FunctionDeclaration.prototype.expression = false;
function FunctionDeclaration(depth, ancestors) {
--depth;
ancestors = [this].concat(ancestors);
this.id = Identifier(depth, ancestors);
this.params = listOf([Pattern])(depth, ancestors);
this.body = BlockStatement(depth, ancestors);
}
return FunctionDeclaration;
}(Node);
module.exports = construct(FunctionDeclaration);
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);