Comparing version 0.3.0 to 0.3.1
@@ -184,6 +184,6 @@ // Acorn: Loose parser | ||
function closesBlock(closeTok, indent, line) { | ||
function closes(closeTok, indent, line, blockHeuristic) { | ||
if (token.type === closeTok || token.type === tt.eof) return true; | ||
if (line != curLineStart && curIndent < indent && tokenStartsLine() && | ||
(nextLineStart >= input.length || | ||
(!blockHeuristic || nextLineStart >= input.length || | ||
indentationAfter(nextLineStart) < indent)) return true; | ||
@@ -217,3 +217,3 @@ return false; | ||
node.loc = new node_loc_t(); | ||
return node | ||
return node; | ||
} | ||
@@ -357,3 +357,3 @@ | ||
for (var cur; !closesBlock(tt.braceR, blockIndent, line);) { | ||
for (var cur; !closes(tt.braceR, blockIndent, line, true);) { | ||
if (token.type === tt._case || token.type === tt._default) { | ||
@@ -455,3 +455,3 @@ var isCase = token.type === tt._case; | ||
node.body = []; | ||
while (!closesBlock(tt.braceR, blockIndent, line)) | ||
while (!closes(tt.braceR, blockIndent, line, true)) | ||
node.body.push(parseStatement()); | ||
@@ -651,3 +651,3 @@ popCx(); | ||
node.value = token.type.atomValue; | ||
node.raw = token.type.keyword | ||
node.raw = token.type.keyword; | ||
next(); | ||
@@ -706,3 +706,3 @@ return finishNode(node, "Literal"); | ||
var propIndent = curIndent, line = curLineStart; | ||
while (!closesBlock(tt.braceR, propIndent, line)) { | ||
while (!closes(tt.braceR, propIndent, line)) { | ||
var name = parsePropertyName(); | ||
@@ -764,8 +764,8 @@ if (!name) { if (isDummy(parseExpression(true))) next(); eat(tt.comma); continue; } | ||
function parseExprList(close) { | ||
var indent = curIndent, line = curLineStart, elts = []; | ||
var indent = curIndent, line = curLineStart, elts = [], continuedLine = nextLineStart; | ||
next(); // Opening bracket | ||
while (!closesBlock(close, indent, line)) { | ||
while (!closes(close, indent + (curLineStart <= continuedLine ? 1 : 0), line)) { | ||
var elt = parseExpression(true); | ||
if (isDummy(elt)) { | ||
if (closesBlock(close, indent, line)) break; | ||
if (closes(close, indent, line)) break; | ||
next(); | ||
@@ -772,0 +772,0 @@ } else { |
@@ -6,3 +6,3 @@ { | ||
"main": "acorn.js", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"engines": {"node": ">=0.4.0"}, | ||
@@ -9,0 +9,0 @@ "maintainers": [{"name": "Marijn Haverbeke", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1630441