From 2fbec9639fdfcdfacb6c4d8dad343b08b2fa6286 Mon Sep 17 00:00:00 2001 From: npt-1707 Date: Mon, 17 Aug 2026 10:12:18 +0800 Subject: [PATCH] client/utils/p5-javascript.js: Fix potentially-exponential regexp --- client/utils/p5-javascript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/utils/p5-javascript.js b/client/utils/p5-javascript.js index af34681c07..cdf9149a06 100644 --- a/client/utils/p5-javascript.js +++ b/client/utils/p5-javascript.js @@ -162,7 +162,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { var kw = keywords[word] return ret(kw.type, kw.style, word) } - if (state.lastType != "." && word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false)) + if (state.lastType != "." && word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false)) return ret("async", "keyword", word) return ret("variable", "variable", word) }