UNPKG

esfuzz

Version:

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

41 lines (40 loc) 1.27 kB
// Generated by CoffeeScript 2.0.0-beta7 void function () { var construct, Expression, LogicalExpression, Node, OPERATORS, randomElement; Node = require('../node'); Expression = require('../classes/Expression'); randomElement = require('../random').randomElement; construct = require('../combinators').construct; OPERATORS = [ '||', '&&' ]; LogicalExpression = function (super$) { extends$(LogicalExpression, super$); LogicalExpression.prototype.type = LogicalExpression.name; function LogicalExpression(depth, ancestors) { --depth; ancestors = [this].concat(ancestors); this.operator = randomElement(OPERATORS); this.left = Expression(depth, ancestors); this.right = Expression(depth, ancestors); } return LogicalExpression; }(Node); module.exports = construct(LogicalExpression); 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);