8134484: disallow backquotes as heredoc end marker delimiters
Reviewed-by: attila, sundar
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java Wed Aug 26 09:59:29 2015 +0200
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java Wed Aug 26 13:11:35 2015 +0200
@@ -1453,7 +1453,7 @@
// Scan identifier. It might be quoted, indicating that no string editing should take place.
final char quoteChar = ch0;
- final boolean noStringEditing = isStringDelimiter(quoteChar);
+ final boolean noStringEditing = quoteChar == '"' || quoteChar == '\'';
if (noStringEditing) {
skip(1);
}
--- a/nashorn/test/script/nosecurity/JDK-8073613.js Wed Aug 26 09:59:29 2015 +0200
+++ b/nashorn/test/script/nosecurity/JDK-8073613.js Wed Aug 26 13:11:35 2015 +0200
@@ -44,10 +44,6 @@
${a}${b}
EOM
-print(<<`EOM`)
-${c}
-EOM
-
print(<<"EOM")
$\{a}
EOM
--- a/nashorn/test/script/nosecurity/JDK-8073613.js.EXPECTED Wed Aug 26 09:59:29 2015 +0200
+++ b/nashorn/test/script/nosecurity/JDK-8073613.js.EXPECTED Wed Aug 26 13:11:35 2015 +0200
@@ -1,5 +1,4 @@
23
${a}${b}
${a}${b}
-${c}
$\{a}