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

Unified Diff: test/mjsunit/harmony/typedarrays.js

Issue 652603002: Fix typedarray tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/typedarrays.js
diff --git a/test/mjsunit/harmony/typedarrays.js b/test/mjsunit/harmony/typedarrays.js
index f26b0be56532ecaeb656e985ddd7410ac49a0079..5b75874cd40685897393613ab693a521318eb828 100644
--- a/test/mjsunit/harmony/typedarrays.js
+++ b/test/mjsunit/harmony/typedarrays.js
@@ -361,14 +361,18 @@ var typedArrayConstructors = [
Float64Array];
function TestPropertyTypeChecks(constructor) {
- var a = new constructor();
function CheckProperty(name) {
var d = Object.getOwnPropertyDescriptor(constructor.prototype, name);
- var o = {}
+ var o = {};
assertThrows(function() {d.get.call(o);}, TypeError);
- d.get.call(a); // shouldn't throw
- for (var i = 0 ; i < typedArrayConstructors.length; i++) {
- d.get.call(new typedArrayConstructors[i](10));
+ for (var i = 0; i < typedArrayConstructors.length; i++) {
+ var ctor = typedArrayConstructors[i];
+ var a = new ctor(10);
+ if (ctor === constructor) {
+ d.get.call(a); // shouldn't throw
+ } else {
+ assertThrows(function() {d.get.call(a);}, TypeError);
+ }
}
}
@@ -378,7 +382,7 @@ function TestPropertyTypeChecks(constructor) {
CheckProperty("length");
}
-for(i = 0; i < typedArrayConstructors.lenght; i++) {
+for(i = 0; i < typedArrayConstructors.length; i++) {
TestPropertyTypeChecks(typedArrayConstructors[i]);
}
@@ -561,7 +565,7 @@ function TestEnumerable(func, obj) {
assertArrayEquals([], props(obj));
}
TestEnumerable(ArrayBuffer, new ArrayBuffer());
-for(i = 0; i < typedArrayConstructors.lenght; i++) {
+for(i = 0; i < typedArrayConstructors.length; i++) {
TestEnumerable(typedArrayConstructors[i]);
}
TestEnumerable(DataView, new DataView(new ArrayBuffer()));
@@ -573,13 +577,13 @@ function TestArbitrary(m) {
assertEquals(value, map[property]);
}
for (var i = 0; i < 20; i++) {
- TestProperty(m, i, 'val' + i);
+ TestProperty(m, 'key' + i, 'val' + i);
TestProperty(m, 'foo' + i, 'bar' + i);
}
}
TestArbitrary(new ArrayBuffer(256));
-for(i = 0; i < typedArrayConstructors.lenght; i++) {
- TestArbitary(new typedArrayConstructors[i](10));
+for(i = 0; i < typedArrayConstructors.length; i++) {
+ TestArbitrary(new typedArrayConstructors[i](10));
}
TestArbitrary(new DataView(new ArrayBuffer(256)));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698