JDK-8030199 : Nashorn: Uint8ClampedArray - Incorrect ToUint8Clamp implementation
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • Submitted: 2013-12-13
  • Updated: 2014-07-29
  • Resolved: 2014-04-14
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
8u20Fixed 9 b10Fixed
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
The ToUint8Clamp implementation for Uint8ClampedArray instances does not correctly clamp input values to [0, 255].

Nashorn version: hg tip 18edd7a1b166

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
jjs> ta = new Uint8ClampedArray(1), ta[0] = 4294967296, ta[0]

Expected: 255
Actual: 0


REPRODUCIBILITY :
This bug can be reproduced always.