8138758: U+180E not recognized as whitespace by Joni

Reviewed-by: attila, sundar
diff --git a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java
index a0a4353..b6b46de 100644
--- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java
+++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/regexp/joni/EncodingHelper.java
@@ -278,8 +278,9 @@
                     case 0x0d:
                         return true;
                     default:
-                        // true if Unicode separator or BOM
-                        return (1 << Character.getType(code) & CharacterType.SPACE_MASK) != 0 || code == 0xfeff;
+                        // true if Unicode separator or BOM or U+180E (see JDK-8138758)
+                        return (1 << Character.getType(code) & CharacterType.SPACE_MASK) != 0
+                                || code == 0xfeff || code == 0x180e;
                 }
             case CharacterType.UPPER:
                 return Character.isUpperCase(code);
diff --git a/nashorn/test/script/basic/JDK-8138758.js b/nashorn/test/script/basic/JDK-8138758.js
new file mode 100644
index 0000000..4047bf2
--- /dev/null
+++ b/nashorn/test/script/basic/JDK-8138758.js
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8138758: U+180E not recognized as whitespace by Joni
+ *
+ * @test
+ * @run
+ */
+
+
+Assert.assertEquals("\u180e".replace(/\s/, "OK"), "OK");
+