Chromium Code Reviews

Unified Diff: test/mjsunit/es6/typedarray.js

Issue 1500543002: [es6] Unify ArrayBuffer and SharedArrayBuffer constructors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: test/mjsunit/es6/typedarray.js
diff --git a/test/mjsunit/es6/typedarray.js b/test/mjsunit/es6/typedarray.js
index a45b6308f319d2b04593f5d5269e6166c59f6864..babb942c5b65e86d55fd3717eac9838c80ab9f21 100644
--- a/test/mjsunit/es6/typedarray.js
+++ b/test/mjsunit/es6/typedarray.js
@@ -39,7 +39,7 @@ function TestArrayBufferCreation() {
TestByteLength(256, 256);
TestByteLength(2.567, 2);
- TestByteLength("abc", 0);
+ TestByteLength("0", 0);
TestByteLength(0, 0);
@@ -52,7 +52,7 @@ function TestArrayBufferCreation() {
}, RangeError);
*/
- var ab = new ArrayBuffer();
+ var ab = new ArrayBuffer(0);
assertSame(0, ab.byteLength);
assertEquals("[object ArrayBuffer]",
Object.prototype.toString.call(ab));
@@ -729,11 +729,11 @@ function TestEnumerable(func, obj) {
if (obj)
assertArrayEquals([], props(obj));
}
-TestEnumerable(ArrayBuffer, new ArrayBuffer());
+TestEnumerable(ArrayBuffer, new ArrayBuffer(0));
for(i = 0; i < typedArrayConstructors.length; i++) {
TestEnumerable(typedArrayConstructors[i]);
}
-TestEnumerable(DataView, new DataView(new ArrayBuffer()));
+TestEnumerable(DataView, new DataView(new ArrayBuffer(0)));
// Test arbitrary properties on ArrayBuffer
function TestArbitrary(m) {
@@ -754,8 +754,8 @@ TestArbitrary(new DataView(new ArrayBuffer(256)));
// Test direct constructor call
-assertThrows(function() { ArrayBuffer(); }, TypeError);
-assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError);
+assertThrows(function() { ArrayBuffer(0); }, TypeError);
+assertThrows(function() { DataView(new ArrayBuffer(0)); }, TypeError);
function TestNonConfigurableProperties(constructor) {
var arr = new constructor([100])

Powered by Google App Engine