Socket
Socket
Sign inDemoInstall

acorn

Package Overview
Dependencies
0
Maintainers
3
Versions
131
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.6.2 to 5.7.0

10

CHANGELOG.md

@@ -0,1 +1,11 @@

## 5.7.0 (2018-06-15)
### Bug fixes
Fix crash in walker when walking a binding-less catch node.
### New features
Upgraded to Unicode 11.
## 5.6.2 (2018-06-05)

@@ -2,0 +12,0 @@

46

dist/acorn_loose.es.js

@@ -114,3 +114,3 @@ import { Node, SourceLocation, Token, addLooseExports, defaultOptions, getLineInfo, isNewLine, lineBreak, lineBreakG, tokTypes, tokenizer } from './acorn.es';

for (var i = 1; i <= 2; i++) {
if (this$1.lookAhead(i).type == type) {
if (this$1.lookAhead(i).type === type) {
for (var j = 0; j < i; j++) { this$1.next(); }

@@ -148,3 +148,3 @@ return true

if (this.tok.type === closeTok || this.tok.type === tokTypes.eof) { return true }
return line != this.curLineStart && this.curIndent < indent && this.tokenStartsLine() &&
return line !== this.curLineStart && this.curIndent < indent && this.tokenStartsLine() &&
(!blockHeuristic || this.nextLineStart >= this.input.length ||

@@ -300,3 +300,3 @@ this.indentationAfter(this.nextLineStart) < indent)

function isDummy(node) { return node.name == "✖" }
function isDummy(node) { return node.name === "✖" }

@@ -595,3 +595,3 @@ var lp$1 = LooseParser.prototype;

if (method.key.type === "Identifier" && !method.computed && method.key.name === "static" &&
(this$1.tok.type != tokTypes.parenL && this$1.tok.type != tokTypes.braceL)) {
(this$1.tok.type !== tokTypes.parenL && this$1.tok.type !== tokTypes.braceL)) {
method.static = true;

@@ -714,3 +714,3 @@ isGenerator = this$1.eat(tokTypes.star);

node.specifiers = this.parseImportSpecifierList();
node.source = this.eatContextual("from") && this.tok.type == tokTypes.string ? this.parseExprAtom() : this.dummyString();
node.source = this.eatContextual("from") && this.tok.type === tokTypes.string ? this.parseExprAtom() : this.dummyString();
if (elt) { node.specifiers.unshift(elt); }

@@ -825,3 +825,3 @@ }

this.next();
if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type != tokTypes.star && !this.tok.type.startsExpr)) {
if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type !== tokTypes.star && !this.tok.type.startsExpr)) {
node.delegate = false;

@@ -869,3 +869,3 @@ node.argument = null;

lp$2.parseExprOp = function(left, start, minPrec, noIn, indent, line) {
if (this.curLineStart != line && this.curIndent < indent && this.tokenStartsLine()) { return left }
if (this.curLineStart !== line && this.curIndent < indent && this.tokenStartsLine()) { return left }
var prec = this.tok.type.binop;

@@ -878,3 +878,3 @@ if (prec != null && (!noIn || this.tok.type !== tokTypes._in)) {

this.next();
if (this.curLineStart != line && this.curIndent < indent && this.tokenStartsLine()) {
if (this.curLineStart !== line && this.curIndent < indent && this.tokenStartsLine()) {
node.right = this.dummyIdent();

@@ -947,4 +947,4 @@ } else {

for (;;) {
if (this$1.curLineStart != line && this$1.curIndent <= startIndent && this$1.tokenStartsLine()) {
if (this$1.tok.type == tokTypes.dot && this$1.curIndent == startIndent)
if (this$1.curLineStart !== line && this$1.curIndent <= startIndent && this$1.tokenStartsLine()) {
if (this$1.tok.type === tokTypes.dot && this$1.curIndent === startIndent)
{ --startIndent; }

@@ -960,3 +960,3 @@ else

node.object = base;
if (this$1.curLineStart != line && this$1.curIndent <= startIndent && this$1.tokenStartsLine())
if (this$1.curLineStart !== line && this$1.curIndent <= startIndent && this$1.tokenStartsLine())
{ node.property = this$1.dummyIdent(); }

@@ -967,3 +967,3 @@ else

base = this$1.finishNode(node, "MemberExpression");
} else if (this$1.tok.type == tokTypes.bracketL) {
} else if (this$1.tok.type === tokTypes.bracketL) {
this$1.pushCx();

@@ -978,3 +978,3 @@ this$1.next();

base = this$1.finishNode(node$1, "MemberExpression");
} else if (!noCalls && this$1.tok.type == tokTypes.parenL) {
} else if (!noCalls && this$1.tok.type === tokTypes.parenL) {
var exprList = this$1.parseExprList(tokTypes.parenR);

@@ -987,3 +987,3 @@ if (maybeAsyncArrow && this$1.eat(tokTypes.arrow))

base = this$1.finishNode(node$2, "CallExpression");
} else if (this$1.tok.type == tokTypes.backQuote) {
} else if (this$1.tok.type === tokTypes.backQuote) {
var node$3 = this$1.startNodeAt(start);

@@ -1102,3 +1102,3 @@ node$3.tag = base;

node.callee = this.parseSubscripts(this.parseExprAtom(), start, true, startIndent, line);
if (this.tok.type == tokTypes.parenL) {
if (this.tok.type === tokTypes.parenL) {
node.arguments = this.parseExprList(tokTypes.parenR);

@@ -1197,3 +1197,3 @@ } else {

!prop.computed && (prop.key.name === "get" || prop.key.name === "set") &&
(this$1.tok.type != tokTypes.comma && this$1.tok.type != tokTypes.braceR && this$1.tok.type != tokTypes.eq)) {
(this$1.tok.type !== tokTypes.comma && this$1.tok.type !== tokTypes.braceR && this$1.tok.type !== tokTypes.eq)) {
prop.kind = prop.key.name;

@@ -1277,9 +1277,9 @@ this$1.parsePropertyName(prop);

if (!node || node.type == "Identifier" || (node.type == "MemberExpression" && !binding)) {
if (!node || node.type === "Identifier" || (node.type === "MemberExpression" && !binding)) {
// Okay
} else if (node.type == "ParenthesizedExpression") {
} else if (node.type === "ParenthesizedExpression") {
this.toAssignable(node.expression, binding);
} else if (this.options.ecmaVersion < 6) {
return this.dummyIdent()
} else if (node.type == "ObjectExpression") {
} else if (node.type === "ObjectExpression") {
node.type = "ObjectPattern";

@@ -1292,11 +1292,11 @@ for (var i = 0, list = node.properties; i < list.length; i += 1)

}
} else if (node.type == "ArrayExpression") {
} else if (node.type === "ArrayExpression") {
node.type = "ArrayPattern";
this.toAssignableList(node.elements, binding);
} else if (node.type == "Property") {
} else if (node.type === "Property") {
this.toAssignable(node.value, binding);
} else if (node.type == "SpreadElement") {
} else if (node.type === "SpreadElement") {
node.type = "RestElement";
this.toAssignable(node.argument, binding);
} else if (node.type == "AssignmentExpression") {
} else if (node.type === "AssignmentExpression") {
node.type = "AssignmentPattern";

@@ -1303,0 +1303,0 @@ delete node.operator;

@@ -118,3 +118,3 @@ (function (global, factory) {

for (var i = 1; i <= 2; i++) {
if (this$1.lookAhead(i).type == type) {
if (this$1.lookAhead(i).type === type) {
for (var j = 0; j < i; j++) { this$1.next(); }

@@ -152,3 +152,3 @@ return true

if (this.tok.type === closeTok || this.tok.type === __acorn.tokTypes.eof) { return true }
return line != this.curLineStart && this.curIndent < indent && this.tokenStartsLine() &&
return line !== this.curLineStart && this.curIndent < indent && this.tokenStartsLine() &&
(!blockHeuristic || this.nextLineStart >= this.input.length ||

@@ -304,3 +304,3 @@ this.indentationAfter(this.nextLineStart) < indent)

function isDummy(node) { return node.name == "✖" }
function isDummy(node) { return node.name === "✖" }

@@ -599,3 +599,3 @@ var lp$1 = LooseParser.prototype;

if (method.key.type === "Identifier" && !method.computed && method.key.name === "static" &&
(this$1.tok.type != __acorn.tokTypes.parenL && this$1.tok.type != __acorn.tokTypes.braceL)) {
(this$1.tok.type !== __acorn.tokTypes.parenL && this$1.tok.type !== __acorn.tokTypes.braceL)) {
method.static = true;

@@ -718,3 +718,3 @@ isGenerator = this$1.eat(__acorn.tokTypes.star);

node.specifiers = this.parseImportSpecifierList();
node.source = this.eatContextual("from") && this.tok.type == __acorn.tokTypes.string ? this.parseExprAtom() : this.dummyString();
node.source = this.eatContextual("from") && this.tok.type === __acorn.tokTypes.string ? this.parseExprAtom() : this.dummyString();
if (elt) { node.specifiers.unshift(elt); }

@@ -829,3 +829,3 @@ }

this.next();
if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type != __acorn.tokTypes.star && !this.tok.type.startsExpr)) {
if (this.semicolon() || this.canInsertSemicolon() || (this.tok.type !== __acorn.tokTypes.star && !this.tok.type.startsExpr)) {
node.delegate = false;

@@ -873,3 +873,3 @@ node.argument = null;

lp$2.parseExprOp = function(left, start, minPrec, noIn, indent, line) {
if (this.curLineStart != line && this.curIndent < indent && this.tokenStartsLine()) { return left }
if (this.curLineStart !== line && this.curIndent < indent && this.tokenStartsLine()) { return left }
var prec = this.tok.type.binop;

@@ -882,3 +882,3 @@ if (prec != null && (!noIn || this.tok.type !== __acorn.tokTypes._in)) {

this.next();
if (this.curLineStart != line && this.curIndent < indent && this.tokenStartsLine()) {
if (this.curLineStart !== line && this.curIndent < indent && this.tokenStartsLine()) {
node.right = this.dummyIdent();

@@ -951,4 +951,4 @@ } else {

for (;;) {
if (this$1.curLineStart != line && this$1.curIndent <= startIndent && this$1.tokenStartsLine()) {
if (this$1.tok.type == __acorn.tokTypes.dot && this$1.curIndent == startIndent)
if (this$1.curLineStart !== line && this$1.curIndent <= startIndent && this$1.tokenStartsLine()) {
if (this$1.tok.type === __acorn.tokTypes.dot && this$1.curIndent === startIndent)
{ --startIndent; }

@@ -964,3 +964,3 @@ else

node.object = base;
if (this$1.curLineStart != line && this$1.curIndent <= startIndent && this$1.tokenStartsLine())
if (this$1.curLineStart !== line && this$1.curIndent <= startIndent && this$1.tokenStartsLine())
{ node.property = this$1.dummyIdent(); }

@@ -971,3 +971,3 @@ else

base = this$1.finishNode(node, "MemberExpression");
} else if (this$1.tok.type == __acorn.tokTypes.bracketL) {
} else if (this$1.tok.type === __acorn.tokTypes.bracketL) {
this$1.pushCx();

@@ -982,3 +982,3 @@ this$1.next();

base = this$1.finishNode(node$1, "MemberExpression");
} else if (!noCalls && this$1.tok.type == __acorn.tokTypes.parenL) {
} else if (!noCalls && this$1.tok.type === __acorn.tokTypes.parenL) {
var exprList = this$1.parseExprList(__acorn.tokTypes.parenR);

@@ -991,3 +991,3 @@ if (maybeAsyncArrow && this$1.eat(__acorn.tokTypes.arrow))

base = this$1.finishNode(node$2, "CallExpression");
} else if (this$1.tok.type == __acorn.tokTypes.backQuote) {
} else if (this$1.tok.type === __acorn.tokTypes.backQuote) {
var node$3 = this$1.startNodeAt(start);

@@ -1106,3 +1106,3 @@ node$3.tag = base;

node.callee = this.parseSubscripts(this.parseExprAtom(), start, true, startIndent, line);
if (this.tok.type == __acorn.tokTypes.parenL) {
if (this.tok.type === __acorn.tokTypes.parenL) {
node.arguments = this.parseExprList(__acorn.tokTypes.parenR);

@@ -1201,3 +1201,3 @@ } else {

!prop.computed && (prop.key.name === "get" || prop.key.name === "set") &&
(this$1.tok.type != __acorn.tokTypes.comma && this$1.tok.type != __acorn.tokTypes.braceR && this$1.tok.type != __acorn.tokTypes.eq)) {
(this$1.tok.type !== __acorn.tokTypes.comma && this$1.tok.type !== __acorn.tokTypes.braceR && this$1.tok.type !== __acorn.tokTypes.eq)) {
prop.kind = prop.key.name;

@@ -1281,9 +1281,9 @@ this$1.parsePropertyName(prop);

if (!node || node.type == "Identifier" || (node.type == "MemberExpression" && !binding)) {
if (!node || node.type === "Identifier" || (node.type === "MemberExpression" && !binding)) {
// Okay
} else if (node.type == "ParenthesizedExpression") {
} else if (node.type === "ParenthesizedExpression") {
this.toAssignable(node.expression, binding);
} else if (this.options.ecmaVersion < 6) {
return this.dummyIdent()
} else if (node.type == "ObjectExpression") {
} else if (node.type === "ObjectExpression") {
node.type = "ObjectPattern";

@@ -1296,11 +1296,11 @@ for (var i = 0, list = node.properties; i < list.length; i += 1)

}
} else if (node.type == "ArrayExpression") {
} else if (node.type === "ArrayExpression") {
node.type = "ArrayPattern";
this.toAssignableList(node.elements, binding);
} else if (node.type == "Property") {
} else if (node.type === "Property") {
this.toAssignable(node.value, binding);
} else if (node.type == "SpreadElement") {
} else if (node.type === "SpreadElement") {
node.type = "RestElement";
this.toAssignable(node.argument, binding);
} else if (node.type == "AssignmentExpression") {
} else if (node.type === "AssignmentExpression") {
node.type = "AssignmentPattern";

@@ -1307,0 +1307,0 @@ delete node.operator;

@@ -7,3 +7,3 @@ {

"module": "dist/acorn.es.js",
"version": "5.6.2",
"version": "5.7.0",
"engines": {

@@ -55,4 +55,4 @@ "node": ">=0.4.0"

"test262-parser-runner": "^0.4.0",
"unicode-10.0.0": "^0.7.5"
"unicode-11.0.0": "^0.7.7"
}
}

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

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc