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

shift-parser

Package Overview
Dependencies
Maintainers
4
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shift-parser - npm Package Compare versions

Comparing version 5.0.3 to 5.0.4

2

dist/early-error-state.js

@@ -468,3 +468,3 @@ 'use strict';

var _this5 = _possibleConstructorReturn(this, (EarlyError.__proto__ || Object.getPrototypeOf(EarlyError)).call(this, message));
var _this5 = _possibleConstructorReturn(this, Object.getPrototypeOf(EarlyError).call(this, message));

@@ -471,0 +471,0 @@ _this5.node = node;

@@ -123,3 +123,3 @@ 'use strict';

return _possibleConstructorReturn(this, (EarlyErrorChecker.__proto__ || Object.getPrototypeOf(EarlyErrorChecker)).call(this, _earlyErrorState.EarlyErrorState));
return _possibleConstructorReturn(this, Object.getPrototypeOf(EarlyErrorChecker).call(this, _earlyErrorState.EarlyErrorState));
}

@@ -130,3 +130,3 @@

value: function reduceAssignmentExpression() {
return _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceAssignmentExpression', this).apply(this, arguments).clearBoundNames();
return _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceAssignmentExpression', this).apply(this, arguments).clearBoundNames();
}

@@ -145,4 +145,4 @@ }, {

value: function reduceArrowExpression(node, _ref2) {
var params = _ref2.params,
body = _ref2.body;
var params = _ref2.params;
var body = _ref2.body;

@@ -163,3 +163,3 @@ var isSimpleParameterList = node.params.rest == null && node.params.items.every(function (i) {

});
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceArrowExpression', this).call(this, node, { params: params, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceArrowExpression', this).call(this, node, { params: params, body: body });
if (!isSimpleParameterList && node.body.type === 'FunctionBody' && isStrictFunctionBody(node.body)) {

@@ -185,3 +185,3 @@ s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive'));

value: function reduceBlock() {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceBlock', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceBlock', this).apply(this, arguments);
s = s.functionDeclarationNamesAreLexical();

@@ -196,3 +196,3 @@ s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);

value: function reduceBreakStatement(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceBreakStatement', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceBreakStatement', this).apply(this, arguments);
s = node.label == null ? s.addFreeBreakStatement(node) : s.addFreeLabeledBreakStatement(node);

@@ -204,3 +204,3 @@ return s;

value: function reduceCallExpression(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceCallExpression', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceCallExpression', this).apply(this, arguments);
if (node.callee.type === 'Super') {

@@ -214,4 +214,4 @@ s = s.observeSuperCallExpression(node);

value: function reduceCatchClause(node, _ref3) {
var binding = _ref3.binding,
body = _ref3.body;
var binding = _ref3.binding;
var body = _ref3.body;

@@ -230,3 +230,3 @@ binding = binding.observeLexicalDeclaration();

});
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceCatchClause', this).call(this, node, { binding: binding, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceCatchClause', this).call(this, node, { binding: binding, body: body });
s = s.observeLexicalBoundary();

@@ -238,5 +238,5 @@ return s;

value: function reduceClassDeclaration(node, _ref4) {
var name = _ref4.name,
_super = _ref4.super,
elements = _ref4.elements;
var name = _ref4.name;
var _super = _ref4.super;
var elements = _ref4.elements;

@@ -261,3 +261,3 @@ var s = name;

value: function reduceClassElement(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceClassElement', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceClassElement', this).apply(this, arguments);
if (!node.isStatic && isSpecialMethod(node.method)) {

@@ -274,5 +274,5 @@ s = s.addError(new _earlyErrorState.EarlyError(node, 'Constructors cannot be generators, getters or setters'));

value: function reduceClassExpression(node, _ref5) {
var name = _ref5.name,
_super = _ref5.super,
elements = _ref5.elements;
var name = _ref5.name;
var _super = _ref5.super;
var elements = _ref5.elements;

@@ -297,3 +297,3 @@ var s = node.name == null ? this.identity : name;

value: function reduceCompoundAssignmentExpression() {
return _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceCompoundAssignmentExpression', this).apply(this, arguments).clearBoundNames();
return _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceCompoundAssignmentExpression', this).apply(this, arguments).clearBoundNames();
}

@@ -303,3 +303,3 @@ }, {

value: function reduceComputedMemberExpression(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceComputedMemberExpression', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceComputedMemberExpression', this).apply(this, arguments);
if (node.object.type === 'Super') {

@@ -313,3 +313,3 @@ s = s.observeSuperPropertyExpression(node);

value: function reduceContinueStatement(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceContinueStatement', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceContinueStatement', this).apply(this, arguments);
s = node.label == null ? s.addFreeContinueStatement(node) : s.addFreeLabeledContinueStatement(node);

@@ -321,3 +321,3 @@ return s;

value: function reduceDoWhileStatement(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceDoWhileStatement', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceDoWhileStatement', this).apply(this, arguments);
if (isLabelledFunction(node.body)) {

@@ -333,3 +333,3 @@ s = s.addError(new _earlyErrorState.EarlyError(node.body, 'The body of a do-while statement must not be a labeled function declaration'));

value: function reduceExport() {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExport', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExport', this).apply(this, arguments);
s = s.functionDeclarationNamesAreLexical();

@@ -342,3 +342,3 @@ s = s.exportDeclaredNames();

value: function reduceExportFrom(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExportFrom', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExportFrom', this).apply(this, arguments);
s = s.clearExportedBindings();

@@ -350,3 +350,3 @@ return s;

value: function reduceExportFromSpecifier(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExportFromSpecifier', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExportFromSpecifier', this).apply(this, arguments);
s = s.exportName(node.exportedName || node.name, node);

@@ -359,3 +359,3 @@ s = s.exportBinding(node.name, node);

value: function reduceExportLocalSpecifier(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExportLocalSpecifier', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExportLocalSpecifier', this).apply(this, arguments);
s = s.exportName(node.exportedName || node.name.name, node);

@@ -368,3 +368,3 @@ s = s.exportBinding(node.name.name, node);

value: function reduceExportDefault(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExportDefault', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceExportDefault', this).apply(this, arguments);
s = s.functionDeclarationNamesAreLexical();

@@ -377,3 +377,3 @@ s = s.exportName('default', node);

value: function reduceFormalParameters() {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceFormalParameters', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceFormalParameters', this).apply(this, arguments);
s = s.observeLexicalDeclaration();

@@ -385,6 +385,6 @@ return s;

value: function reduceForStatement(node, _ref6) {
var init = _ref6.init,
test = _ref6.test,
update = _ref6.update,
body = _ref6.body;
var init = _ref6.init;
var test = _ref6.test;
var update = _ref6.update;
var body = _ref6.body;

@@ -395,3 +395,3 @@ if (init != null) {

}
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceForStatement', this).call(this, node, { init: init, test: test, update: update, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceForStatement', this).call(this, node, { init: init, test: test, update: update, body: body });
if (node.init != null && node.init.type === 'VariableDeclaration' && node.init.kind === 'const') {

@@ -415,9 +415,9 @@ node.init.declarators.forEach(function (declarator) {

value: function reduceForInStatement(node, _ref7) {
var left = _ref7.left,
right = _ref7.right,
body = _ref7.body;
var left = _ref7.left;
var right = _ref7.right;
var body = _ref7.body;
left = left.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);
left = left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING);
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceForInStatement', this).call(this, node, { left: left, right: right, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceForInStatement', this).call(this, node, { left: left, right: right, body: body });
if (isLabelledFunction(node.body)) {

@@ -434,5 +434,5 @@ s = s.addError(new _earlyErrorState.EarlyError(node.body, 'The body of a for-in statement must not be a labeled function declaration'));

value: function reduceForOfStatement(node, _ref8) {
var left = _ref8.left,
right = _ref8.right,
body = _ref8.body;
var left = _ref8.left;
var right = _ref8.right;
var body = _ref8.body;

@@ -442,3 +442,3 @@ left = left.recordForOfVars();

left = left.enforceConflictingLexicallyDeclaredNames(body.varDeclaredNames, DUPLICATE_BINDING);
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceForOfStatement', this).call(this, node, { left: left, right: right, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceForOfStatement', this).call(this, node, { left: left, right: right, body: body });
if (isLabelledFunction(node.body)) {

@@ -455,3 +455,3 @@ s = s.addError(new _earlyErrorState.EarlyError(node.body, 'The body of a for-of statement must not be a labeled function declaration'));

value: function reduceFunctionBody(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceFunctionBody', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceFunctionBody', this).apply(this, arguments);
s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);

@@ -473,5 +473,5 @@ s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING);

value: function reduceFunctionDeclaration(node, _ref9) {
var name = _ref9.name,
params = _ref9.params,
body = _ref9.body;
var name = _ref9.name;
var params = _ref9.params;
var body = _ref9.body;

@@ -505,3 +505,3 @@ var isSimpleParameterList = node.params.rest == null && node.params.items.every(function (i) {

}
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceFunctionDeclaration', this).call(this, node, { name: name, params: params, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceFunctionDeclaration', this).call(this, node, { name: name, params: params, body: body });
if (!isSimpleParameterList && isStrictFunctionBody(node.body)) {

@@ -517,5 +517,5 @@ s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive'));

value: function reduceFunctionExpression(node, _ref10) {
var name = _ref10.name,
params = _ref10.params,
body = _ref10.body;
var name = _ref10.name;
var params = _ref10.params;
var body = _ref10.body;

@@ -549,3 +549,3 @@ var isSimpleParameterList = node.params.rest == null && node.params.items.every(function (i) {

}
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceFunctionExpression', this).call(this, node, { name: name, params: params, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceFunctionExpression', this).call(this, node, { name: name, params: params, body: body });
if (!isSimpleParameterList && isStrictFunctionBody(node.body)) {

@@ -562,4 +562,4 @@ s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive'));

value: function reduceGetter(node, _ref11) {
var name = _ref11.name,
body = _ref11.body;
var name = _ref11.name;
var body = _ref11.body;

@@ -572,3 +572,3 @@ body = body.enforceSuperCallExpressions(SUPERCALL_ERROR);

}
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceGetter', this).call(this, node, { name: name, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceGetter', this).call(this, node, { name: name, body: body });
s = s.observeVarBoundary();

@@ -589,5 +589,5 @@ return s;

value: function reduceIfStatement(node, _ref12) {
var test = _ref12.test,
consequent = _ref12.consequent,
alternate = _ref12.alternate;
var test = _ref12.test;
var consequent = _ref12.consequent;
var alternate = _ref12.alternate;

@@ -608,3 +608,3 @@ if (isLabelledFunction(node.consequent)) {

}
return _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceIfStatement', this).call(this, node, { test: test, consequent: consequent, alternate: alternate });
return _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceIfStatement', this).call(this, node, { test: test, consequent: consequent, alternate: alternate });
}

@@ -614,3 +614,3 @@ }, {

value: function reduceImport() {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceImport', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceImport', this).apply(this, arguments);
s = s.observeLexicalDeclaration();

@@ -622,3 +622,3 @@ return s;

value: function reduceImportNamespace() {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceImportNamespace', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceImportNamespace', this).apply(this, arguments);
s = s.observeLexicalDeclaration();

@@ -630,3 +630,3 @@ return s;

value: function reduceLabeledStatement(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceLabeledStatement', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceLabeledStatement', this).apply(this, arguments);
if (node.label === 'yield' || (0, _utils.isStrictModeReservedWord)(node.label)) {

@@ -657,5 +657,5 @@ s = s.addStrictError(new _earlyErrorState.EarlyError(node, 'The identifier ' + JSON.stringify(node.label) + ' must not be in label position in strict mode'));

value: function reduceMethod(node, _ref13) {
var name = _ref13.name,
params = _ref13.params,
body = _ref13.body;
var name = _ref13.name;
var params = _ref13.params;
var body = _ref13.body;

@@ -687,3 +687,3 @@ var isSimpleParameterList = node.params.rest == null && node.params.items.every(function (i) {

}
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceMethod', this).call(this, node, { name: name, params: params, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceMethod', this).call(this, node, { name: name, params: params, body: body });
if (!isSimpleParameterList && isStrictFunctionBody(node.body)) {

@@ -699,3 +699,3 @@ s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive'));

value: function reduceModule() {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceModule', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceModule', this).apply(this, arguments);
s = s.functionDeclarationNamesAreLexical();

@@ -738,3 +738,3 @@ s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);

value: function reduceObjectExpression(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceObjectExpression', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceObjectExpression', this).apply(this, arguments);
s = s.enforceSuperCallExpressionsInConstructorMethod(SUPERCALL_ERROR);

@@ -752,3 +752,3 @@ var protos = node.properties.filter(function (p) {

value: function reduceUpdateExpression(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceUpdateExpression', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceUpdateExpression', this).apply(this, arguments);
s = s.clearBoundNames();

@@ -760,3 +760,3 @@ return s;

value: function reduceUnaryExpression(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceUnaryExpression', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceUnaryExpression', this).apply(this, arguments);
if (node.operator === 'delete' && node.operand.type === 'IdentifierExpression') {

@@ -770,3 +770,3 @@ s = s.addStrictError(new _earlyErrorState.EarlyError(node, 'Identifier expressions must not be deleted in strict mode'));

value: function reduceScript(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceScript', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceScript', this).apply(this, arguments);
s = s.enforceDuplicateLexicallyDeclaredNames(DUPLICATE_BINDING);

@@ -791,5 +791,5 @@ s = s.enforceConflictingLexicallyDeclaredNames(s.varDeclaredNames, DUPLICATE_BINDING);

value: function reduceSetter(node, _ref14) {
var name = _ref14.name,
param = _ref14.param,
body = _ref14.body;
var name = _ref14.name;
var param = _ref14.param;
var body = _ref14.body;

@@ -810,3 +810,3 @@ var isSimpleParameterList = node.param.type === 'BindingIdentifier';

}
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceSetter', this).call(this, node, { name: name, param: param, body: body });
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceSetter', this).call(this, node, { name: name, param: param, body: body });
if (!isSimpleParameterList && isStrictFunctionBody(node.body)) {

@@ -821,3 +821,3 @@ s = s.addError(new _earlyErrorState.EarlyError(node, 'Functions with non-simple parameter lists may not contain a "use strict" directive'));

value: function reduceStaticMemberExpression(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceStaticMemberExpression', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceStaticMemberExpression', this).apply(this, arguments);
if (node.object.type === 'Super') {

@@ -831,4 +831,4 @@ s = s.observeSuperPropertyExpression(node);

value: function reduceSwitchStatement(node, _ref15) {
var discriminant = _ref15.discriminant,
cases = _ref15.cases;
var discriminant = _ref15.discriminant;
var cases = _ref15.cases;

@@ -847,6 +847,6 @@ var sCases = this.fold(cases);

value: function reduceSwitchStatementWithDefault(node, _ref16) {
var discriminant = _ref16.discriminant,
preDefaultCases = _ref16.preDefaultCases,
defaultCase = _ref16.defaultCase,
postDefaultCases = _ref16.postDefaultCases;
var discriminant = _ref16.discriminant;
var preDefaultCases = _ref16.preDefaultCases;
var defaultCase = _ref16.defaultCase;
var postDefaultCases = _ref16.postDefaultCases;

@@ -865,3 +865,3 @@ var sCases = this.append(defaultCase, this.append(this.fold(preDefaultCases), this.fold(postDefaultCases)));

value: function reduceVariableDeclaration(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceVariableDeclaration', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceVariableDeclaration', this).apply(this, arguments);
switch (node.kind) {

@@ -888,3 +888,3 @@ case 'const':

value: function reduceVariableDeclarationStatement(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceVariableDeclarationStatement', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceVariableDeclarationStatement', this).apply(this, arguments);
if (node.declaration.kind === 'const') {

@@ -902,3 +902,3 @@ node.declaration.declarators.forEach(function (declarator) {

value: function reduceWhileStatement(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceWhileStatement', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceWhileStatement', this).apply(this, arguments);
if (isLabelledFunction(node.body)) {

@@ -913,3 +913,3 @@ s = s.addError(new _earlyErrorState.EarlyError(node.body, 'The body of a while statement must not be a labeled function declaration'));

value: function reduceWithStatement(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceWithStatement', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceWithStatement', this).apply(this, arguments);
if (isLabelledFunction(node.body)) {

@@ -924,3 +924,3 @@ s = s.addError(new _earlyErrorState.EarlyError(node.body, 'The body of a with statement must not be a labeled function declaration'));

value: function reduceYieldExpression(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceYieldExpression', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceYieldExpression', this).apply(this, arguments);
s = s.observeYieldExpression(node);

@@ -932,3 +932,3 @@ return s;

value: function reduceYieldGeneratorExpression(node) {
var s = _get(EarlyErrorChecker.prototype.__proto__ || Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceYieldGeneratorExpression', this).apply(this, arguments);
var s = _get(Object.getPrototypeOf(EarlyErrorChecker.prototype), 'reduceYieldGeneratorExpression', this).apply(this, arguments);
s = s.observeYieldExpression(node);

@@ -935,0 +935,0 @@ return s;

@@ -63,3 +63,3 @@ 'use strict';

var _this = _possibleConstructorReturn(this, (ParserWithLocation.__proto__ || Object.getPrototypeOf(ParserWithLocation)).call(this, source));
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ParserWithLocation).call(this, source));

@@ -97,6 +97,7 @@ _this.locations = new WeakMap();

return function parse(code) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$earlyErrors = _ref.earlyErrors,
earlyErrors = _ref$earlyErrors === undefined ? true : _ref$earlyErrors;
var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var _ref$earlyErrors = _ref.earlyErrors;
var earlyErrors = _ref$earlyErrors === undefined ? true : _ref$earlyErrors;
var parser = new _parser.GenericParser(code);

@@ -108,5 +109,5 @@ var tree = parser[parsingFunctionName]();

if (errors.length > 0) {
var _errors$ = errors[0],
node = _errors$.node,
message = _errors$.message;
var _errors$ = errors[0];
var node = _errors$.node;
var message = _errors$.message;

@@ -122,6 +123,7 @@ throw new _tokenizer.JsError(0, 1, 0, message);

return function parse(code) {
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref2$earlyErrors = _ref2.earlyErrors,
earlyErrors = _ref2$earlyErrors === undefined ? true : _ref2$earlyErrors;
var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var _ref2$earlyErrors = _ref2.earlyErrors;
var earlyErrors = _ref2$earlyErrors === undefined ? true : _ref2$earlyErrors;
var parser = new ParserWithLocation(code);

@@ -133,9 +135,9 @@ var tree = parser[parsingFunctionName]();

if (errors.length > 0) {
var _errors$2 = errors[0],
node = _errors$2.node,
message = _errors$2.message;
var _parser$locations$get = parser.locations.get(node).start,
offset = _parser$locations$get.offset,
line = _parser$locations$get.line,
column = _parser$locations$get.column;
var _errors$2 = errors[0];
var node = _errors$2.node;
var message = _errors$2.message;
var _parser$locations$get = parser.locations.get(node).start;
var offset = _parser$locations$get.offset;
var line = _parser$locations$get.line;
var column = _parser$locations$get.column;

@@ -142,0 +144,0 @@ throw new _tokenizer.JsError(offset, line, column, message);

@@ -165,3 +165,3 @@ 'use strict';

var _this = _possibleConstructorReturn(this, (JsError.__proto__ || Object.getPrototypeOf(JsError)).call(this, msg));
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(JsError).call(this, msg));

@@ -168,0 +168,0 @@ _this.index = index;

@@ -16,20 +16,20 @@ 'use strict';

var strictReservedWords = new Set(['null', 'true', 'false', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'let', 'if', 'in', 'do', 'var', 'for', 'new', 'try', 'this', 'else', 'case', 'void', 'with', 'enum', 'while', 'break', 'catch', 'throw', 'const', 'yield', 'class', 'super', 'return', 'typeof', 'delete', 'switch', 'export', 'import', 'default', 'finally', 'extends', 'function', 'continue', 'debugger', 'instanceof']); /**
* Copyright 2017 Shape Security, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var strictReservedWords = ['null', 'true', 'false', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'let', 'if', 'in', 'do', 'var', 'for', 'new', 'try', 'this', 'else', 'case', 'void', 'with', 'enum', 'while', 'break', 'catch', 'throw', 'const', 'yield', 'class', 'super', 'return', 'typeof', 'delete', 'switch', 'export', 'import', 'default', 'finally', 'extends', 'function', 'continue', 'debugger', 'instanceof']; /**
* Copyright 2017 Shape Security, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function isStrictModeReservedWord(id) {
return strictReservedWords.has(id);
return strictReservedWords.indexOf(id) !== -1;
}

@@ -36,0 +36,0 @@

{
"name": "shift-parser",
"version": "5.0.3",
"version": "5.0.4",
"description": "ECMAScript parser that produces a Shift format AST",

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

Sorry, the diff of this file is too big to display

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