[Pkg-javascript-commits] [node-acorn-jsx] 387/484: [loose parser] Fetch token before comment when tokenizer raises unterminated comment error
Bastien Roucariès
rouca at moszumanska.debian.org
Sat Aug 19 14:21:00 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-acorn-jsx.
commit 0f55a53a7df559847cac7bb748b70d3b454d0cd8
Author: Marijn Haverbeke <marijnh at gmail.com>
Date: Tue Jan 13 22:18:55 2015 +0100
[loose parser] Fetch token before comment when tokenizer raises unterminated comment error
Closes #197
---
acorn.js | 1 +
acorn_loose.js | 2 ++
2 files changed, 3 insertions(+)
diff --git a/acorn.js b/acorn.js
index 3836dc4..06134a0 100644
--- a/acorn.js
+++ b/acorn.js
@@ -242,6 +242,7 @@
tokExprAllowed = !!exprAllowed;
skipSpace();
};
+ getToken.current = function() { return new Token(); };
getToken.options = options;
return getToken;
};
diff --git a/acorn_loose.js b/acorn_loose.js
index f575dd3..62626fe 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -105,6 +105,8 @@
replace = {start: e.pos, end: pos,
type: input.charAt(e.pos) == "`" ? tt.template : tt.templateContinued,
value: input.slice(e.pos + 1, pos)};
+ } else if (/comment/.test(msg)) {
+ replace = fetchToken.current();
} else {
replace = false;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git
More information about the Pkg-javascript-commits
mailing list