Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1582)

Unified Diff: test/mjsunit/harmony/dataview-accessors.js

Issue 17572009: Update typed arrays behavior to match ES6 rev 15. Remove TO_POSITIVE_INTEGER and throw on negative … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/typedarray.js ('k') | test/mjsunit/harmony/typedarrays.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/typedarray.js ('k') | test/mjsunit/harmony/typedarrays.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698