From c26b84a67998acf268945cc05d34686fb37db957 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Wed, 3 Jul 2024 08:08:59 +0200 Subject: [PATCH] Don't use an /s regexp FIX: Fix a regression that caused Acorn to no longer run on Node versions <8.10. Closes https://github.com/acornjs/acorn/issues/1305 See https://github.com/acornjs/acorn/pull/1283 --- acorn/src/parseutil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acorn/src/parseutil.js b/acorn/src/parseutil.js index 730642c37..9e0be0a8b 100644 --- a/acorn/src/parseutil.js +++ b/acorn/src/parseutil.js @@ -6,7 +6,7 @@ const pp = Parser.prototype // ## Parser utilities -const literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/s +const literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/ pp.strictDirective = function(start) { if (this.options.ecmaVersion < 5) return false for (;;) {