Index: test/mjsunit/harmony/dataview-accessors.js |
diff --git a/test/mjsunit/harmony/dataview-accessors.js b/test/mjsunit/harmony/dataview-accessors.js |
index 3b7cc093bc22f0598150474d0d6d83e4c66f8649..9dd8fe35e046b87b08fcbabfc7c286380de87622 100644 |
--- a/test/mjsunit/harmony/dataview-accessors.js |
+++ b/test/mjsunit/harmony/dataview-accessors.js |
@@ -64,8 +64,7 @@ function checkGet(func, index, expected, littleEndian) { |
function doGet() { |
return view["get" + func](index, littleEndian); |
} |
- if (index < 0) index = 0; |
- if (index + getElementSize(func) - 1 < view.byteLength) |
+ if (index >=0 && index + getElementSize(func) - 1 < view.byteLength) |
assertSame(expected, doGet()); |
else |
assertThrows(doGet, RangeError); |
@@ -75,9 +74,8 @@ function checkSet(func, index, value, littleEndian) { |
function doSet() { |
view["set" + func](index, value, littleEndian); |
} |
- actualIndex = index < 0 ? 0 : index; |
- if (actualIndex >= 0 && |
- actualIndex + getElementSize(func) - 1 < view.byteLength) { |
+ if (index >= 0 && |
+ index + getElementSize(func) - 1 < view.byteLength) { |
assertSame(undefined, doSet()); |
checkGet(func, index, value, littleEndian); |
} else { |