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

shift-validator

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shift-validator - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

70

lib/index.js

@@ -18,6 +18,3 @@ "use strict";

var keyword = require("esutils").keyword;
var isRestrictedWord = keyword.isRestrictedWord;
var isIdentifierName = keyword.isIdentifierName;
var isReservedWordES5 = keyword.isReservedWordES5;
var isReservedWordES6 = keyword.isReservedWordES6;
var ValidationContext = require("./validation-context").ValidationContext;

@@ -54,4 +51,4 @@ var ValidationError = require("./validation-context").ValidationError;

var v = MonoidalReducer.prototype.reduceAssignmentExpression.call(this, node, binding, expression);
if (node.binding.type === "IdentifierExpression" && isRestrictedWord(node.binding.identifier.name)) {
v = v.addStrictError(new ValidationError(node, "IdentifierExpression must not be a restricted word"));
if (node.binding.type === "IdentifierExpression") {
v = v.checkRestricted(node.binding.identifier);
}

@@ -67,7 +64,3 @@ return v;

Validator.prototype.reduceCatchClause = function (node, param, body) {
var v = MonoidalReducer.prototype.reduceCatchClause.call(this, node, param, body);
if (isRestrictedWord(node.binding.name)) {
v = v.addStrictError(new ValidationError(node, "CatchClause binding must not be restricted in strict mode"));
}
return v;
return MonoidalReducer.prototype.reduceCatchClause.call(this, node, param, body).checkRestricted(node.binding);
};

@@ -113,16 +106,9 @@

Validator.prototype.reduceFunctionDeclaration = function (node, name, parameters, functionBody) {
var v = MonoidalReducer.prototype.reduceFunctionDeclaration.call(this, node, name, parameters, functionBody).clearUsedLabelNames().clearFreeReturnStatements();
var v = MonoidalReducer.prototype.reduceFunctionDeclaration.call(this, node, name, parameters, functionBody).clearUsedLabelNames().clearFreeReturnStatements().checkRestricted(node.name);
if (!uniqueIdentifiers(node.parameters)) {
v = v.addStrictError(new ValidationError(node, "FunctionDeclaration must have unique parameter names"));
}
v = node.parameters.reduce(function (v1, param) {
if (isRestrictedWord(param.name)) {
return v1.addStrictError(new ValidationError(param, "FunctionDeclaration parameter name must not be restricted word"));
}
return v1;
return node.parameters.reduce(function (v1, param) {
return v1.checkRestricted(param);
}, v);
if (isRestrictedWord(node.name.name)) {
v = v.addStrictError(new ValidationError(node, "FunctionDeclaration `name` must not be `eval` or `arguments` in strict mode"));
}
return v;
};

@@ -132,12 +118,11 @@

var v = MonoidalReducer.prototype.reduceFunctionExpression.call(this, node, name, parameters, functionBody).clearFreeReturnStatements();
if (node.name != null) {
v = v.checkRestricted(node.name);
}
if (!uniqueIdentifiers(node.parameters)) {
v = v.addStrictError(new ValidationError(node, "FunctionExpression parameter names must be unique"));
}
v = node.parameters.reduce(function (v1, param) {
if (isRestrictedWord(param.name)) {
return v1.addStrictError(new ValidationError(param, "FunctionExpression parameter name must not be restricted word"));
}
return v1;
return node.parameters.reduce(function (v1, param) {
return v1.checkRestricted(param);
}, v);
return node.name == null || !isRestrictedWord(node.name.name) ? v : v.addStrictError(new ValidationError(node, "FunctionExpression `name` must not be `eval` or `arguments` in strict mode"));
};

@@ -150,5 +135,2 @@

}
if (isReservedWordES5(node.name, false)) {
v = v.addError(new ValidationError(node, "Identifier `name` must not be a reserved word"));
}
return v;

@@ -158,9 +140,3 @@ };

Validator.prototype.reduceIdentifierExpression = function (node, identifier) {
var v = MonoidalReducer.prototype.reduceIdentifierExpression.call(this, node, identifier);
if (isReservedWordES5(node.identifier.name)) {
v = v.addStrictError(new ValidationError(node, "Reserved word used in IdentifierExpression"));
} else if (isReservedWordES6(node.identifier.name, true)) {
v = v.addStrictError(new ValidationError(node, "Strict mode reserved word used in IdentifierExpression"));
}
return v;
return MonoidalReducer.prototype.reduceIdentifierExpression.call(this, node, identifier).checkReserved(node.identifier);
};

@@ -250,4 +226,4 @@

var v = MonoidalReducer.prototype.reducePostfixExpression.call(this, node, operand);
if ((node.operator === "++" || node.operator === "--") && node.operand.type === "IdentifierExpression" && isRestrictedWord(node.operand.identifier.name)) {
v = v.addStrictError(new ValidationError(node, "Restricted words must not be incremented/decremented in strict mode"));
if ((node.operator === "++" || node.operator === "--") && node.operand.type === "IdentifierExpression") {
v = v.checkRestricted(node.operand.identifier);
}

@@ -261,4 +237,4 @@ return v;

v = v.addStrictError(new ValidationError(node, "`delete` with unqualified identifier not allowed in strict mode"));
} else if ((node.operator === "++" || node.operator === "--") && node.operand.type === "IdentifierExpression" && isRestrictedWord(node.operand.identifier.name)) {
v = v.addStrictError(new ValidationError(node, "Restricted words must not be incremented/decremented in strict mode"));
} else if ((node.operator === "++" || node.operator === "--") && node.operand.type === "IdentifierExpression") {
v = v.checkRestricted(node.operand.identifier);
}

@@ -277,7 +253,3 @@ return v;

Validator.prototype.reduceSetter = function (node, name, parameter, body) {
var v = MonoidalReducer.prototype.reduceSetter.call(this, node, name, parameter, body);
if (isRestrictedWord(node.parameter.name)) {
v = v.addStrictError(new ValidationError(node, "SetterProperty parameter must not be a restricted name"));
}
return v;
return MonoidalReducer.prototype.reduceSetter.call(this, node, name, parameter, body).checkRestricted(node.parameter);
};

@@ -294,7 +266,3 @@

Validator.prototype.reduceVariableDeclarator = function (node, binding, init) {
var v = MonoidalReducer.prototype.reduceVariableDeclarator.call(this, node, binding, init);
if (isRestrictedWord(node.binding.name)) {
v = v.addStrictError(new ValidationError(node, "VariableDeclarator must not be restricted name"));
}
return v;
return MonoidalReducer.prototype.reduceVariableDeclarator.call(this, node, binding, init).checkRestricted(node.binding);
};

@@ -314,2 +282,2 @@

exports.Validator = Validator;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztJQWdCTyxNQUFNO0lBQUcsZUFBZSw0QkFBZixlQUFlO0lBQ3ZCLE9BQU8sc0JBQVAsT0FBTztJQUNSLGdCQUFnQixHQUE0RCxPQUFPLENBQW5GLGdCQUFnQ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blxuICByZWR1Y2VXaXRoU3RhdGVtZW50KG5vZGUsIG9iamVjdCwgYm9keSkge1xuICAgIHJldHVybiBzdXBlci5yZWR1Y2VXaXRoU3RhdGVtZW50KG5vZGUsIG9iamVjdCwgYm9keSlcbiAgICAgIC5hZGRTdHJpY3RFcnJvcihuZXcgVmFsaWRhdGlvbkVycm9yKG5vZGUsIFwiV2l0aFN0YXRlbWVudCBub3QgYWxsb3dlZCBpbiBzdHJpY3QgbW9kZVwiKSk7XG4gIH1cblxuICByZWR1Y2VXaGlsZVN0YXRlbWVudChub2RlLCB0ZXN0LCBib2R5KSB7XG4gICAgcmV0dXJuIHN1cGVyLnJlZHVjZVdoaWxlU3RhdGVtZW50KG5vZGUsIHRlc3QsIGJvZHkpXG4gICAgICAuY2xlYXJGcmVlQnJlYWtTdGF0ZW1lbnRzKClcbiAgICAgIC5jbGVhckZyZWVDb250aW51ZVN0YXRlbWVudHMoKTtcbiAgfVxufVxuIl19

@@ -15,2 +15,5 @@ "use strict";

var keyword = require("esutils").keyword;
var isRestrictedWord = keyword.isRestrictedWord;
var isReservedWordES5 = keyword.isReservedWordES5;
var ValidationContext = (function () {

@@ -69,2 +72,20 @@ var ValidationContext = function ValidationContext(freeBreakStatements, freeContinueStatements, usedLabelNames, freeJumpTargets, freeReturnStatements, errors, strictErrors) {

ValidationContext.prototype.checkReserved = function (identifier) {
if (isReservedWordES5(identifier.name, true)) {
if (isReservedWordES5(identifier.name, false)) {
return this.addError(new ValidationError(identifier, "Identifier must not be reserved word in this position"));
}
return this.addStrictError(new ValidationError(identifier, "Identifier must not be strict mode reserved word in this position"));
}
return this;
};
ValidationContext.prototype.checkRestricted = function (identifier) {
var v = this.checkReserved(identifier);
if (isRestrictedWord(identifier.name)) {
return v.addStrictError(new ValidationError(identifier, "Identifier must not be restricted word in this position in strict mode"));
}
return v;
};
ValidationContext.prototype.addError = function (e) {

@@ -102,2 +123,2 @@ return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames, this.freeJumpTargets, this.freeReturnStatements, this.errors.concat([e]), this.strictErrors);

exports.ValidationError = ValidationError;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy92YWxpZGF0aW9uLWNvbnRleHQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7SUFnQmEsaUJBQWlCO01BQWpCLGlCQUFpQixHQUVqQixTQUZBLGlCQUFpQixDQUVoQixtQkFBbUIsRUFBRSxzQkFBc0IsRUFBRSxjQUFjLEVBQUUsZUFBZSxFQUFFLG9CQUFvQixFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQUU7QUFDcEksUUFBSSxDQUFDLG1CQUFtQixHQUFHLG1CQUFtQixDQUFDO0FBQy9DLFFBQUksQ0FBQyxzQkFBc0IsR0FBRyxzQkFBc0IsQ0FBQztBQUNyRCxRQUFJLENBQUMsY0FBYyxHQUFHLGNBQWMsQ0FBQztBQUNyQyxRQUFJLENBQUMsZUFBZSxHQUFHLGVBQWUsQ0FBQztBQUN2QyxRQUFJLENBQUMsb0JBQW9CLEdBQUcsb0JBQW9CLENBQUM7QUFDakQsUUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7QUFDckIsUUFBSSxDQUFDLFlBQVksR0FBRyxZQUFZLENBQUM7R0FDbEM7O0FBVlUsbUJBQWlCLENBWXJCLEtBQUssR0FBQSxZQUFHO0FBQ2IsV0FBTyxJQUFJLGlCQUFpQixDQUFDLEVBQUUsRUFBQyxFQUFFLEVBQUMsRUFBRSxFQUFDLEVBQUUsRUFBQyxFQUFFLEVBQUMsRUFBRSxFQUFDLEVBQUUsQ0FBQyxDQUFDO0dBQ3BEOztBQWRVLG1CQUFpQixXQWdCNUIscUJBQXFCLEdBQUEsVUFBQyxDQUFDLEVBQUU7QUFDdkIsV0FBTyxJQUFJLGlCQUFpQixDQUMxQixJQUFJLENBQUMsbUJBQW1CLENBQU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hbWVzLmNvbmNhdCh2LnVzZWRMYWJlbE5hbWVzKSxcbiAgICAgIHRoaXMuZnJlZUp1bXBUYXJnZXRzLmNvbmNhdCh2LmZyZWVKdW1wVGFyZ2V0cyksXG4gICAgICB0aGlzLmZyZWVSZXR1cm5TdGF0ZW1lbnRzLmNvbmNhdCh2LmZyZWVSZXR1cm5TdGF0ZW1lbnRzKSxcbiAgICAgIHRoaXMuZXJyb3JzLmNvbmNhdCh2LmVycm9ycyksXG4gICAgICB0aGlzLnN0cmljdEVycm9ycy5jb25jYXQodi5zdHJpY3RFcnJvcnMpXG4gICAgKTtcbiAgfVxufVxuXG5leHBvcnQgY2xhc3MgVmFsaWRhdGlvbkVycm9yIGV4dGVuZHMgRXJyb3Ige1xuICBjb25zdHJ1Y3Rvcihub2RlLCBtZXNzYWdlKSB7XG4gICAgdGhpcy5ub2RlID0gbm9kZTtcbiAgICB0aGlzLm1lc3NhZ2UgPSBtZXNzYWdlO1xuICB9XG59XG4iXX0=
{
"name": "shift-validator",
"version": "1.0.1",
"version": "1.0.2",
"description": "validator for the Shift AST format",

@@ -5,0 +5,0 @@ "author": "Shape Security Labs",

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