UNPKG

esfuzz

Version:

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

62 lines (61 loc) 2.09 kB
// Generated by CoffeeScript 2.0.0-beta7 void function () { var cache$, construct, DynamicMemberExpression, Expression, IdentifierName, MemberExpression, Node, oneOf, StaticMemberExpression; Node = require('../node'); Expression = require('../classes/Expression'); IdentifierName = require('./IdentifierName'); cache$ = require('../combinators'); construct = cache$.construct; oneOf = cache$.oneOf; MemberExpression = function (super$) { extends$(MemberExpression, super$); MemberExpression.prototype.type = MemberExpression.name; function MemberExpression(depth, ancestors) { --depth; ancestors = [this].concat(ancestors); this.object = Expression(depth, ancestors); } return MemberExpression; }(Node); DynamicMemberExpression = function (super$) { extends$(DynamicMemberExpression, super$); function DynamicMemberExpression(depth, ancestors) { MemberExpression.apply(this, arguments); --depth; ancestors = [this].concat(ancestors); this.property = Expression(depth, ancestors); this.computed = true; } return DynamicMemberExpression; }(MemberExpression); StaticMemberExpression = function (super$) { extends$(StaticMemberExpression, super$); function StaticMemberExpression(depth, ancestors) { MemberExpression.apply(this, arguments); --depth; ancestors = [this].concat(ancestors); this.property = IdentifierName(depth, ancestors); this.computed = false; } return StaticMemberExpression; }(MemberExpression); module.exports = oneOf([ construct(DynamicMemberExpression), construct(StaticMemberExpression) ]); 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);