Comparing version 0.3.1 to 0.4.0
@@ -32,7 +32,7 @@ // Acorn: Loose parser | ||
(function(mod) { | ||
(function(root, mod) { | ||
if (typeof exports == "object" && typeof module == "object") return mod(exports, require("./acorn")); // CommonJS | ||
if (typeof define == "function" && define.amd) return define(["exports", "./acorn"], mod); // AMD | ||
mod(this.acorn || (this.acorn = {}), this.acorn); // Plain browser env | ||
})(function(exports, acorn) { | ||
mod(root.acorn || (root.acorn = {}), root.acorn); // Plain browser env | ||
})(this, function(exports, acorn) { | ||
"use strict"; | ||
@@ -172,6 +172,2 @@ | ||
} | ||
function lineStart(pos) { | ||
while (pos > 0 && !isNewline(input.charCodeAt(pos - 1))) --pos; | ||
return pos; | ||
} | ||
function indentationAfter(pos) { | ||
@@ -431,3 +427,3 @@ for (var count = 0;; ++pos) { | ||
default: | ||
var maybeName = token.value, expr = parseExpression(); | ||
var expr = parseExpression(); | ||
if (isDummy(expr)) { | ||
@@ -588,4 +584,3 @@ next(); | ||
function parseExprSubscripts() { | ||
var indent = curIndent, line = curLineStart; | ||
return parseSubscripts(parseExprAtom(), false, curIndent, line); | ||
return parseSubscripts(parseExprAtom(), false, curIndent, curLineStart); | ||
} | ||
@@ -764,2 +759,3 @@ | ||
next(); // Opening bracket | ||
if (curLineStart > continuedLine) continuedLine = curLineStart; | ||
while (!closes(close, indent + (curLineStart <= continuedLine ? 1 : 0), line)) { | ||
@@ -766,0 +762,0 @@ var elt = parseExpression(true); |
@@ -6,3 +6,3 @@ { | ||
"main": "acorn.js", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"engines": {"node": ">=0.4.0"}, | ||
@@ -9,0 +9,0 @@ "maintainers": [{"name": "Marijn Haverbeke", |
@@ -5,3 +5,3 @@ require("./jquery-string.js"); | ||
function test(lib, name) { | ||
for (var i =0, t0 = +new Date; i < 30; ++i) lib.parse(codemirror30); | ||
for (var i =0, t0 = +new Date; i < 60; ++i) lib.parse(codemirror30); | ||
console.log(name + ": " + (+new Date - t0) + "ms"); | ||
@@ -8,0 +8,0 @@ } |
@@ -147,3 +147,3 @@ // AST walker module for Mozilla Parser API compatible trees | ||
function skipThrough(node, st, c) { c(node, st); } | ||
function ignore(node, st, c) {} | ||
function ignore(_node, _st, _c) {} | ||
@@ -150,0 +150,0 @@ // Node walkers. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
1638085
49053