diff --git a/acorn.js b/acorn.js index 945439c5c3..e3214dc6d0 100644 --- a/acorn.js +++ b/acorn.js @@ -27,7 +27,7 @@ })(this, function(exports) { "use strict"; - exports.version = "0.3.2"; + exports.version = "0.4.0"; // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and diff --git a/index.html b/index.html index b7569c8947..6aa2bb6dc7 100644 --- a/index.html +++ b/index.html @@ -21,7 +21,7 @@ with a error-tolerant parser and an })(this, function(exports) { "use strict"; - exports.version = "0.3.2";
The main exported interface (under self.acorn when in the
+ exports.version = "0.4.0";
The main exported interface (under self.acorn when in the
browser) is a parse function that takes a code string and
returns an abstract syntax tree as specified by Mozilla parser
API, with the caveat that the SpiderMonkey-specific syntax
@@ -333,8 +333,10 @@ whitespace and comments, and.
function setStrict(strct) {
strict = strct;
tokPos = lastEnd;
- while (tokPos < tokLineStart) {
- tokLineStart = input.lastIndexOf("\n", tokLineStart - 2) + 1;
- --tokCurLine;
+ if (options.locations) {
+ while (tokPos < tokLineStart) {
+ tokLineStart = input.lastIndexOf("\n", tokLineStart - 2) + 1;
+ --tokCurLine;
+ }
}
skipSpace();
readToken();
diff --git a/package.json b/package.json
index f2fb071f2e..d923c9a9cc 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"description": "ECMAScript parser",
"homepage": "http://marijnhaverbeke.nl/acorn/",
"main": "acorn.js",
- "version": "0.3.2",
+ "version": "0.4.0",
"engines": {"node": ">=0.4.0"},
"maintainers": [{"name": "Marijn Haverbeke",
"email": "marijnh@gmail.com",