JDK-8030202 : Nashorn: Multiple RegExp#ignoreCase issues
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 8u20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • CPU: generic
  • Submitted: 2013-12-13
  • Updated: 2014-07-29
  • Resolved: 2014-05-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u20 b17Fixed 9Fixed
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
Nashorn version: hg tip 18edd7a1b166

The implementation for case-insensitive regular expressions does not comply to [ES5.1 - 15.10.2.8 Canonicalize]. This applies to both implementations, java.util.regex and Joni.

I've noticed this while working on integrating Joni for my project. You should be able to port the necessary changes from here [1]:
- UCS2Encoding.java contains the relevant changes for runtime.regexp.joni.EncodingHelper
- RegExpParser.java#L1256-L1412 contains the relevant changes for the java.util.regex based implementation

[1] https://github.com/anba/es6draft/tree/master/src/main/java/com/github/anba/es6draft/regexp

ADDITIONAL REGRESSION INFORMATION:
Java(TM) SE Runtime Environment (build 1.8.0-ea-b119)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b61, mixed mode)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Test cases:

jjs> /[\u2160]/i.test("\u2170")

Expected: true
Actual: false


jjs> /\u0130/i.test("\u0069")

Expected: false
Actual: true


jjs> /\u1e9e/i.test("\u00df")

Expected: false
Actual: true


jjs> /\u0345{4}/i.test("\u0345\u0399\u03b9\u1fbe")

Expected: true
Actual: false


REPRODUCIBILITY :
This bug can be reproduced always.