8134484: disallow backquotes as heredoc end marker delimiters
authormhaupt
Wed, 26 Aug 2015 13:11:35 +0200
changeset 32322 5e140163c89f
parent 32321 b883916a29ff
child 32323 ec97bf27ad3b
8134484: disallow backquotes as heredoc end marker delimiters Reviewed-by: attila, sundar
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/Lexer.java
nashorn/test/script/nosecurity/JDK-8073613.js
nashorn/test/script/nosecurity/JDK-8073613.js.EXPECTED
--- 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}