From f6c45ac59f613585eae2a4fbb556b26c325a4a6c Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Wed, 14 Jan 2015 23:10:10 +0200 Subject: [PATCH] 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 7d3bcb2082..bdb026566e 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) {