Handle quotes correctly in JS regexp checker (IJ-CR-4082)

GitOrigin-RevId: 6d4ad33be59e44e5368322b266a9274b2b9335ab
This commit is contained in:
Bas Leijdekkers
2020-11-17 18:06:45 +01:00
committed by intellij-monorepo-bot
parent 6c7b31d5c9
commit 71fbd42e5b

View File

@@ -47,7 +47,7 @@ public class EcmaScriptRegExpMatcherProvider implements RegExpMatcherProvider {
@Language("Nashorn JS")
final String script =
"var regexp = RegExp(\"" + StringUtil.escapeStringCharacters(regExp) + "\",'g" + modifiers + "');\n" +
"var str = '" + StringUtil.escapeStringCharacters(sampleText) + "';\n" +
"var str = \"" + StringUtil.escapeStringCharacters(sampleText) + "\";\n" +
"var match;\n" +
"\n" +
"var RegExpMatch = Java.type(\"org.intellij.lang.regexp.RegExpMatch\");\n" +