Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

astgen

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astgen - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

131

lib/builder.js

@@ -219,3 +219,4 @@ // Generated by CoffeeScript 1.6.3

function ArrayPattern(elts, loc) {
function ArrayPattern(elements, loc) {
this.elements = elements;
if (loc == null) {

@@ -225,3 +226,2 @@ loc = null;

ArrayPattern.__super__.constructor.call(this, 'ArrayPattern', loc);
this.elements = elts;
isArrayOf(this.elements, Pattern);

@@ -269,3 +269,4 @@ }

function AssignmentExpression(op, left, right, loc) {
function AssignmentExpression(operator, left, right, loc) {
this.operator = operator;
this.left = left;

@@ -277,3 +278,2 @@ this.right = right;

AssignmentExpression.__super__.constructor.call(this, 'AssignmentExpression', loc);
this.operator = op;
isLiterally(this.operator, AssignmentOperator);

@@ -291,3 +291,4 @@ isA(this.left, Expression);

function BinaryExpression(op, left, right, loc) {
function BinaryExpression(operator, left, right, loc) {
this.operator = operator;
this.left = left;

@@ -299,3 +300,2 @@ this.right = right;

BinaryExpression.__super__.constructor.call(this, 'BinaryExpression', loc);
this.operator = op;
isLiterally(this.operator, BinaryOperator);

@@ -345,4 +345,5 @@ isA(this.left, Expression);

function CallExpression(callee, args, loc) {
function CallExpression(callee, _arguments, loc) {
this.callee = callee;
this["arguments"] = _arguments != null ? _arguments : [];
if (loc == null) {

@@ -352,3 +353,2 @@ loc = null;

CallExpression.__super__.constructor.call(this, 'CallExpression', loc);
this["arguments"] = args;
isA(this.callee, Expression);

@@ -425,4 +425,6 @@ isArrayOf(this["arguments"], Expression);

function ConditionalExpression(test, cons, alt, loc) {
function ConditionalExpression(test, consequent, alternate, loc) {
this.test = test;
this.consequent = consequent;
this.alternate = alternate;
if (loc == null) {

@@ -432,4 +434,2 @@ loc = null;

ConditionalExpression.__super__.constructor.call(this, 'ConditionalExpression', loc);
this.consequent = cons;
this.alternate = alt;
isA(this.test, Expression);

@@ -509,3 +509,4 @@ isA(this.consequent, Expression);

function ExpressionStatement(expr, loc) {
function ExpressionStatement(expression, loc) {
this.expression = expression;
if (loc == null) {

@@ -515,3 +516,2 @@ loc = null;

ExpressionStatement.__super__.constructor.call(this, 'ExpressionStatement', loc);
this.expression = expr;
isA(this.expression, Expression);

@@ -596,5 +596,5 @@ }

this.id = id;
this.params = params;
this.defaults = defaults;
this.rest = rest;
this.params = params != null ? params : [];
this.defaults = defaults != null ? defaults : [];
this.rest = rest != null ? rest : null;
this.body = body;

@@ -630,6 +630,6 @@ if (isGenerator == null) {

function FunctionExpression(id, params, defaults, rest, body, isGenerator, isExpression, loc) {
this.id = id;
this.params = params;
this.defaults = defaults;
this.rest = rest;
this.id = id != null ? id : null;
this.params = params != null ? params : [];
this.defaults = defaults != null ? defaults : [];
this.rest = rest != null ? rest : null;
this.body = body;

@@ -700,4 +700,6 @@ if (isGenerator == null) {

function IfStatement(test, cons, alt, loc) {
function IfStatement(test, consequent, alternate, loc) {
this.test = test;
this.consequent = consequent;
this.alternate = alternate != null ? alternate : null;
if (loc == null) {

@@ -707,4 +709,2 @@ loc = null;

IfStatement.__super__.constructor.call(this, 'IfStatement', loc);
this.consequent = cons;
this.alternate = alt;
isA(this.test, Expression);

@@ -776,3 +776,4 @@ isA(this.consequent, Statement);

function LogicalExpression(op, left, right, loc) {
function LogicalExpression(operator, left, right, loc) {
this.operator = operator;
this.left = left;

@@ -784,3 +785,2 @@ this.right = right;

LogicalExpression.__super__.constructor.call(this, 'LogicalExpression', loc);
this.operator = op;
isLiterally(this.operator, LogicalOperator);

@@ -798,3 +798,8 @@ isA(this.left, Expression);

function MemberExpression(obj, prop, isComputed, loc) {
function MemberExpression(object, property, isComputed, loc) {
this.object = object;
this.property = property;
if (isComputed == null) {
isComputed = false;
}
if (loc == null) {

@@ -804,4 +809,2 @@ loc = null;

MemberExpression.__super__.constructor.call(this, 'MemberExpression', loc);
this.object = obj;
this.property = prop;
this.computed = isComputed;

@@ -820,4 +823,5 @@ isA(this.object, Expression);

function NewExpression(callee, args, loc) {
function NewExpression(callee, _arguments, loc) {
this.callee = callee;
this["arguments"] = _arguments != null ? _arguments : [];
if (loc == null) {

@@ -827,3 +831,2 @@ loc = null;

NewExpression.__super__.constructor.call(this, 'NewExpression', loc);
this["arguments"] = args;
isA(this.callee, Expression);

@@ -840,3 +843,4 @@ isArrayOf(this["arguments"], Expression);

function ObjectExpression(props, loc) {
function ObjectExpression(properties, loc) {
this.properties = properties != null ? properties : [];
if (loc == null) {

@@ -846,3 +850,2 @@ loc = null;

ObjectExpression.__super__.constructor.call(this, 'ObjectExpression', loc);
this.properties = props;
isArrayOf(this.properties, Property);

@@ -858,3 +861,4 @@ }

function ObjectPattern(props, loc) {
function ObjectPattern(properties, loc) {
this.properties = properties != null ? properties : [];
if (loc == null) {

@@ -864,3 +868,2 @@ loc = null;

ObjectPattern.__super__.constructor.call(this, 'ObjectPattern', loc);
this.properties = props;
isArrayOf(this.properties, PropertyPattern);

@@ -877,3 +880,3 @@ }

function Program(body, loc) {
this.body = body;
this.body = body != null ? body : [];
if (loc == null) {

@@ -893,4 +896,5 @@ loc = null;

function Property(key, val, kind, loc) {
function Property(key, value, kind, loc) {
this.key = key;
this.value = value;
this.kind = kind;

@@ -901,3 +905,2 @@ if (loc == null) {

Property.__super__.constructor.call(this, 'Property', loc);
this.value = val;
isOneOf(this.key, [Literal, Identifier]);

@@ -915,4 +918,5 @@ isA(this.value, Expression);

function PropertyPattern(key, patt, loc) {
function PropertyPattern(key, value, loc) {
this.key = key;
this.value = value;
if (loc == null) {

@@ -922,3 +926,2 @@ loc = null;

PropertyPattern.__super__.constructor.call(this, 'PropertyPattern', loc);
this.value = patt;
isOneOf(this.key, [Literal, Identifier]);

@@ -935,3 +938,4 @@ isA(this.value, Pattern);

function ReturnStatement(arg, loc) {
function ReturnStatement(argument, loc) {
this.argument = argument;
if (loc == null) {

@@ -941,3 +945,2 @@ loc = null;

ReturnStatement.__super__.constructor.call(this, 'ReturnStatement', loc);
this.argument = arg;
isNullOr(this.argument, Expression);

@@ -953,3 +956,4 @@ }

function SequenceExpression(exprs, loc) {
function SequenceExpression(expressions, loc) {
this.expressions = expressions;
if (loc == null) {

@@ -959,3 +963,2 @@ loc = null;

SequenceExpression.__super__.constructor.call(this, 'SequenceExpression', loc);
this.expressions = exprs;
isArrayOf(this.expressions, Expression);

@@ -972,2 +975,3 @@ }

function SpreadExpression(argument, loc) {
this.argument = argument;
if (loc == null) {

@@ -977,3 +981,2 @@ loc = null;

SpreadExpression.__super__.constructor.call(this, 'SpreadExpression', loc);
this.argument = argument;
isA(this.argument, Expression);

@@ -989,4 +992,5 @@ }

function SwitchCase(test, cons, loc) {
function SwitchCase(test, consequent, loc) {
this.test = test;
this.consequent = consequent != null ? consequent : [];
if (loc == null) {

@@ -996,3 +1000,2 @@ loc = null;

SwitchCase.__super__.constructor.call(this, 'SwitchCase', loc);
this.consequent = cons;
isNullOr(this.test, Expression);

@@ -1009,3 +1012,4 @@ isArrayOf(this.consequent, Statement);

function SwitchStatement(disc, cases, isLexical, loc) {
function SwitchStatement(discriminant, cases, isLexical, loc) {
this.discriminant = discriminant;
this.cases = cases;

@@ -1016,3 +1020,2 @@ if (loc == null) {

SwitchStatement.__super__.constructor.call(this, 'SwitchStatement', loc);
this.discriminant = disc;
this.lexical = isLexical;

@@ -1045,3 +1048,4 @@ isA(this.discriminant, Expression);

function ThrowStatement(arg, loc) {
function ThrowStatement(argument, loc) {
this.argument = argument;
if (loc == null) {

@@ -1051,3 +1055,2 @@ loc = null;

ThrowStatement.__super__.constructor.call(this, 'ThrowStatement', loc);
this.argument = arg;
isA(this.argument, Expression);

@@ -1063,5 +1066,6 @@ }

function TryStatement(body, handler, fin, loc) {
function TryStatement(body, handler, finalizer, loc) {
this.body = body;
this.handler = handler;
this.finalizer = finalizer;
if (loc == null) {

@@ -1071,3 +1075,2 @@ loc = null;

TryStatement.__super__.constructor.call(this, 'TryStatement', loc);
this.finalizer = fin;
isA(this.body, Statement);

@@ -1085,3 +1088,5 @@ isNullOr(this.handler, CatchClause);

function UnaryExpression(op, arg, isPrefix, loc) {
function UnaryExpression(operator, argument, isPrefix, loc) {
this.operator = operator;
this.argument = argument;
if (loc == null) {

@@ -1091,4 +1096,2 @@ loc = null;

UnaryExpression.__super__.constructor.call(this, 'UnaryExpression', loc);
this.operator = op;
this.argument = arg;
this.prefix = isPrefix;

@@ -1107,3 +1110,5 @@ isLiterally(this.operator, UnaryOperator);

function UpdateExpression(op, arg, isPrefix, loc) {
function UpdateExpression(operator, argument, isPrefix, loc) {
this.operator = operator;
this.argument = argument;
if (loc == null) {

@@ -1113,4 +1118,2 @@ loc = null;

UpdateExpression.__super__.constructor.call(this, 'UpdateExpression', loc);
this.operator = op;
this.argument = arg;
this.prefix = isPrefix;

@@ -1129,4 +1132,5 @@ isLiterally(this.operator, UpdateOperator);

function VariableDeclaration(kind, dtors, loc) {
function VariableDeclaration(kind, declarations, loc) {
this.kind = kind;
this.declarations = declarations;
if (loc == null) {

@@ -1136,3 +1140,2 @@ loc = null;

VariableDeclaration.__super__.constructor.call(this, 'VariableDeclaration', loc);
this.declarations = dtors;
isA(this.kind, 'string');

@@ -1149,3 +1152,4 @@ isArrayOf(this.declarations, VariableDeclarator);

function VariableDeclarator(patt, init, loc) {
function VariableDeclarator(id, init, loc) {
this.id = id;
this.init = init != null ? init : null;

@@ -1156,3 +1160,2 @@ if (loc == null) {

VariableDeclarator.__super__.constructor.call(this, 'VariableDeclarator', loc);
this.id = patt;
isA(this.id, Pattern);

@@ -1205,3 +1208,4 @@ isNullOr(this.init, Expression);

function YieldExpression(arg, loc) {
function YieldExpression(argument, loc) {
this.argument = argument;
if (loc == null) {

@@ -1211,3 +1215,2 @@ loc = null;

YieldExpression.__super__.constructor.call(this, 'YieldExpression', loc);
this.argument = arg;
isNullOr(this.argument, Expression);

@@ -1214,0 +1217,0 @@ }

{
"name": "astgen",
"version": "0.0.6",
"version": "0.0.7",
"description": "Generate SpiderMonkey-compatible JavaScript abstract syntax trees",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc