[Pkg-javascript-commits] [node-acorn-jsx] 393/484: Re-read only number or string after "use strict".
Bastien Roucariès
rouca at moszumanska.debian.org
Sat Aug 19 14:21:01 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 f6c45ac59f613585eae2a4fbb556b26c325a4a6c
Author: Ingvar Stepanyan <me at rreverser.com>
Date: Wed Jan 14 23:10:10 2015 +0200
Re-read only number or string after "use strict".
Fixes double-entering same tokContext for various parentheses.
---
acorn.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/acorn.js b/acorn.js
index 7d3bcb2..bdb0265 100644
--- a/acorn.js
+++ b/acorn.js
@@ -1289,11 +1289,12 @@
readToken();
}
- // Enter strict mode. Re-reads the next token to please pedantic
- // tests ("use strict"; 010; -- should fail).
+ // Enter strict mode. Re-reads the next number or string to
+ // please pedantic tests ("use strict"; 010; -- should fail).
function setStrict(strct) {
strict = strct;
+ if (tokType !== _num && tokType !== _string) return;
tokPos = tokStart;
if (options.locations) {
while (tokPos < tokLineStart) {
--
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