changeset 1392:d61744c0d1d2

8134484: disallow backquotes as heredoc end marker delimiters Reviewed-by: attila, sundar
author mhaupt
date Wed, 26 Aug 2015 13:11:35 +0200
parents 5efd65e18b71
children f0365514f0b3
files src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java test/script/nosecurity/JDK-8073613.js test/script/nosecurity/JDK-8073613.js.EXPECTED
diffstat 3 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java	Wed Aug 26 09:59:29 2015 +0200
+++ b/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/test/script/nosecurity/JDK-8073613.js	Wed Aug 26 09:59:29 2015 +0200
+++ b/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/test/script/nosecurity/JDK-8073613.js.EXPECTED	Wed Aug 26 09:59:29 2015 +0200
+++ b/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}