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.2 to 1.0.3

96

lib/index.js

@@ -37,2 +37,48 @@ "use strict";

exports["default"] = isValid;
function isIterationStatement(type) {
switch (type) {
case "DoWhileStatement":
case "WhileStatement":
case "ForStatement":
case "ForInStatement":
return true;
}
return false;
}
function trailingStatement(node) {
switch (node.type) {
case "IfStatement":
if (node.alternate != null) {
return node.alternate;
}
return node.consequent;
case "LabeledStatement":
case "ForStatement":
case "ForInStatement":
case "WhileStatement":
case "WithStatement":
return node.body;
}
return null;
}
function isProblematicIfStatement(node) {
if (node.type !== "IfStatement") {
return false;
}
if (node.alternate == null) {
return false;
}
var current = node.consequent;
do {
if (current.type === "IfStatement" && current.alternate == null) {
return true;
}
current = trailingStatement(current);
} while (current != null);
return false;
}
var Validator = (function (MonoidalReducer) {

@@ -59,3 +105,3 @@ var Validator = function Validator() {

var v = MonoidalReducer.prototype.reduceBreakStatement.call(this, node, label);
return node.label == null ? v.addFreeBreakStatement(new ValidationError(node, "break must be nested within switch or iteration statement")) : v.addFreeJumpTarget(node.label);
return node.label == null ? v.addFreeBreakStatement(new ValidationError(node, "BreakStatement must be nested within switch or iteration statement")) : v.addFreeBreakJumpTarget(node.label);
};

@@ -68,4 +114,4 @@

Validator.prototype.reduceContinueStatement = function (node, body, label) {
var v = MonoidalReducer.prototype.reduceContinueStatement.call(this, node, body, label).addFreeContinueStatement(new ValidationError(node, "Continue statement must be inside a recursive loop"));
return node.label == null ? v : v.addFreeJumpTarget(node.label);
var v = MonoidalReducer.prototype.reduceContinueStatement.call(this, node, body, label).addFreeContinueStatement(new ValidationError(node, "ContinueStatement must be inside an iteration statement"));
return node.label == null ? v : v.addFreeContinueJumpTarget(node.label);
};

@@ -100,5 +146,5 @@

if (isStrict) {
v = v.addErrors(v.strictErrors);
v = v.enforceStrictErrors();
}
return v.addErrors(v.freeBreakStatements).addErrors(v.freeContinueStatements);
return v.enforceFreeBreakAndContinueStatementErrors();
};

@@ -129,2 +175,6 @@

Validator.prototype.reduceGetter = function (node, name, body) {
return MonoidalReducer.prototype.reduceGetter.call(this, node, name, body).clearFreeReturnStatements();
};
Validator.prototype.reduceIdentifier = function (node) {

@@ -142,2 +192,10 @@ var v = this.identity;

Validator.prototype.reduceIfStatement = function (node, test, consequent, alternate) {
var v = MonoidalReducer.prototype.reduceIfStatement.call(this, node, test, consequent, alternate);
if (isProblematicIfStatement(node)) {
v = v.addError(new ValidationError(node, "IfStatement with null `alternate` must not be the `consequent` of an IfStatement with a non-null `alternate`"));
}
return v;
};
Validator.prototype.reduceLabeledStatement = function (node, label, body) {

@@ -150,3 +208,6 @@ var v = MonoidalReducer.prototype.reduceLabeledStatement.call(this, node, label, body);

}
return v.observeLabelName(node.label);
if (isIterationStatement(node.body.type)) {
return v.observeIterationLabelName(node.label);
}
return v.observeNonIterationLabelName(node.label);
};

@@ -242,2 +303,19 @@

Validator.prototype.reducePropertyName = function (node) {
var v = MonoidalReducer.prototype.reducePropertyName.call(this, node);
switch (node.kind) {
case "identifier":
if (!isIdentifierName(node.value)) {
v = v.addError(new ValidationError(node, "PropertyName with identifier kind must have IdentifierName value"));
}
break;
case "number":
if (!/^(?:0|[1-9]\d*\.?\d*)$/.test(node.value)) {
v = v.addError(new ValidationError(node, "PropertyName with number kind must have numeric value"));
}
break;
}
return v;
};
Validator.prototype.reduceReturnStatement = function (node, expression) {

@@ -248,7 +326,7 @@ return MonoidalReducer.prototype.reduceReturnStatement.call(this, node, expression).addFreeReturnStatement(new ValidationError(node, "Return statement must be inside of a function"));

Validator.prototype.reduceScript = function (node, body) {
return MonoidalReducer.prototype.reduceScript.call(this, node, body).addErrors(body.freeReturnStatements);
return MonoidalReducer.prototype.reduceScript.call(this, node, body).enforceFreeReturnStatementErrors();
};
Validator.prototype.reduceSetter = function (node, name, parameter, body) {
return MonoidalReducer.prototype.reduceSetter.call(this, node, name, parameter, body).checkRestricted(node.parameter);
return MonoidalReducer.prototype.reduceSetter.call(this, node, name, parameter, body).clearFreeReturnStatements().checkRestricted(node.parameter);
};

@@ -280,2 +358,2 @@

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

34

lib/validation-context.js

@@ -49,8 +49,14 @@ "use strict";

ValidationContext.prototype.observeLabelName = function (l) {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames.concat([l.name]), this.freeJumpTargets.filter(function (identifier) {
return identifier.name !== l.name;
ValidationContext.prototype.observeIterationLabelName = function (label) {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames.concat([label.name]), this.freeJumpTargets.filter(function (info) {
return info.name !== label.name;
}), this.freeReturnStatements, this.errors, this.strictErrors);
};
ValidationContext.prototype.observeNonIterationLabelName = function (label) {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames.concat([label.name]), this.freeJumpTargets.filter(function (info) {
return info.name !== label.name || info.type !== "break";
}), this.freeReturnStatements, this.errors, this.strictErrors);
};
ValidationContext.prototype.clearUsedLabelNames = function () {

@@ -60,6 +66,10 @@ return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, [], this.freeJumpTargets, this.freeReturnStatements, this.errors, this.strictErrors);

ValidationContext.prototype.addFreeJumpTarget = function (l) {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames, this.freeJumpTargets.concat([l]), this.freeReturnStatements, this.errors, this.strictErrors);
ValidationContext.prototype.addFreeBreakJumpTarget = function (label) {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames, this.freeJumpTargets.concat([{ name: label.name, type: "break" }]), this.freeReturnStatements, this.errors, this.strictErrors);
};
ValidationContext.prototype.addFreeContinueJumpTarget = function (label) {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames, this.freeJumpTargets.concat([{ name: label.name, type: "continue" }]), this.freeReturnStatements, this.errors, this.strictErrors);
};
ValidationContext.prototype.addFreeReturnStatement = function (r) {

@@ -95,6 +105,14 @@ return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames, this.freeJumpTargets, this.freeReturnStatements.concat([r]), this.errors, this.strictErrors);

ValidationContext.prototype.addErrors = function (errors) {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames, this.freeJumpTargets, this.freeReturnStatements, this.errors.concat(errors), this.strictErrors);
ValidationContext.prototype.enforceFreeBreakAndContinueStatementErrors = function () {
return new ValidationContext([], [], this.usedLabelNames, this.freeJumpTargets, this.freeReturnStatements, this.errors.concat(this.freeBreakStatements).concat(this.freeContinueStatements), this.strictErrors);
};
ValidationContext.prototype.enforceFreeReturnStatementErrors = function () {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames, this.freeJumpTargets, [], this.errors.concat(this.freeReturnStatements), this.strictErrors);
};
ValidationContext.prototype.enforceStrictErrors = function () {
return new ValidationContext(this.freeBreakStatements, this.freeContinueStatements, this.usedLabelNames, this.freeJumpTargets, this.freeReturnStatements, this.errors.concat(this.strictErrors), []);
};
ValidationContext.prototype.addStrictError = function (e) {

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

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

@@ -21,8 +21,10 @@ "author": "Shape Security Labs",

"esutils": "^1.1.6",
"shift-reducer": "^1.0.2"
"shift-reducer": "^1.0.3"
},
"devDependencies": {
"6to5": "^1.14.14",
"everything.js": "0.0.4",
"mocha": "^2.0.1",
"shift-ast": "^1.0.0"
"shift-ast": "^1.0.3",
"shift-parser": "^1.0.2"
},

@@ -29,0 +31,0 @@ "keywords": [

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