--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IdentNode.java Fri Oct 13 15:22:02 2017 +0200
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/IdentNode.java Fri Oct 13 17:25:12 2017 +0200
@@ -477,4 +477,14 @@
public IdentNode setIsDestructuredParameter() {
return new IdentNode(this, name, type, flags | DESTRUCTURED_PARAMETER, programPoint, conversion);
}
+
+ /**
+ * Checks whether the source code for this ident contains a unicode escape sequence by comparing
+ * the length of its name with its length in source code.
+ *
+ * @return true if ident source contains a unicode escape sequence
+ */
+ public boolean containsEscapes() {
+ return Token.descLength(getToken()) != name.length();
+ }
}