aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannesw <none@none>2017-06-14 10:07:07 +0200
committerhannesw <none@none>2017-06-14 10:07:07 +0200
commite0598f235523ebd5345fb804c72c729aed924370 (patch)
treedff37e10d2c3901a0469f728c295d07b198ae349 /src
parent728c6cc8e121a12cb5c06c8f282350d58bdde758 (diff)
downloadjdk8u_nashorn-e0598f235523ebd5345fb804c72c729aed924370.tar.gz
8181191: getUint32 returning Long
Reviewed-by: attila, jlaskey
Diffstat (limited to 'src')
-rw-r--r--src/jdk/nashorn/internal/objects/NativeDataView.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/jdk/nashorn/internal/objects/NativeDataView.java b/src/jdk/nashorn/internal/objects/NativeDataView.java
index 44d06065..759c168b 100644
--- a/src/jdk/nashorn/internal/objects/NativeDataView.java
+++ b/src/jdk/nashorn/internal/objects/NativeDataView.java
@@ -416,7 +416,7 @@ public class NativeDataView extends ScriptObject {
* @return 32-bit unsigned int value at the byteOffset
*/
@Function(attributes = Attribute.NOT_ENUMERABLE, arity = 1)
- public static long getUint32(final Object self, final Object byteOffset, final Object littleEndian) {
+ public static double getUint32(final Object self, final Object byteOffset, final Object littleEndian) {
try {
return 0xFFFFFFFFL & getBuffer(self, littleEndian).getInt(JSType.toInt32(byteOffset));
} catch (final IllegalArgumentException iae) {
@@ -432,7 +432,7 @@ public class NativeDataView extends ScriptObject {
* @return 32-bit unsigned int value at the byteOffset
*/
@SpecializedFunction
- public static long getUint32(final Object self, final int byteOffset) {
+ public static double getUint32(final Object self, final int byteOffset) {
try {
return JSType.toUint32(getBuffer(self, false).getInt(JSType.toInt32(byteOffset)));
} catch (final IllegalArgumentException iae) {
@@ -449,7 +449,7 @@ public class NativeDataView extends ScriptObject {
* @return 32-bit unsigned int value at the byteOffset
*/
@SpecializedFunction
- public static long getUint32(final Object self, final int byteOffset, final boolean littleEndian) {
+ public static double getUint32(final Object self, final int byteOffset, final boolean littleEndian) {
try {
return JSType.toUint32(getBuffer(self, littleEndian).getInt(JSType.toInt32(byteOffset)));
} catch (final IllegalArgumentException iae) {
@@ -837,9 +837,9 @@ public class NativeDataView extends ScriptObject {
* @return undefined
*/
@SpecializedFunction
- public static Object setUint32(final Object self, final int byteOffset, final long value) {
+ public static Object setUint32(final Object self, final int byteOffset, final double value) {
try {
- getBuffer(self, false).putInt(byteOffset, (int)value);
+ getBuffer(self, false).putInt(byteOffset, (int) JSType.toUint32(value));
return UNDEFINED;
} catch (final IllegalArgumentException iae) {
throw rangeError(iae, "dataview.offset");
@@ -856,9 +856,9 @@ public class NativeDataView extends ScriptObject {
* @return undefined
*/
@SpecializedFunction
- public static Object setUint32(final Object self, final int byteOffset, final long value, final boolean littleEndian) {
+ public static Object setUint32(final Object self, final int byteOffset, final double value, final boolean littleEndian) {
try {
- getBuffer(self, littleEndian).putInt(byteOffset, (int)value);
+ getBuffer(self, littleEndian).putInt(byteOffset, (int) JSType.toUint32(value));
return UNDEFINED;
} catch (final IllegalArgumentException iae) {
throw rangeError(iae, "dataview.offset");