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

Unified Diff: test/mjsunit/external-array.js

Issue 9429015: Added no argument constructor support to external arrays. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 10 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/d8.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/external-array.js
===================================================================
--- test/mjsunit/external-array.js (revision 10785)
+++ test/mjsunit/external-array.js (working copy)
@@ -43,11 +43,11 @@
assertEquals(0, a[0]);
assertEquals(0, a[1]);
-// No-parameter constructor should fail right now.
+// No-parameter constructor shouldn't fail
function abfunc1() {
return new ArrayBuffer();
}
-assertThrows(abfunc1);
+assertDoesNotThrow(abfunc1);
// Test derivation from an ArrayBuffer
var ab = new ArrayBuffer(12);
@@ -351,3 +351,37 @@
%OptimizeFunctionOnNextCall(store_float64_undefined);
store_float64_undefined(float64_array);
assertTrue(isNaN(float64_array[0]));
+
+// test external arrays call() and apply() methods with no arguments
+function testNoArgCallApply(type) {
+ assertDoesNotThrow(type.call({}));
+ assertDoesNotThrow(type.apply({}));
+}
+
+// compare type.call() and new type() own property names
+function testNoArgCallAndNewOwnPropertyNames(type) {
+ var o1 = type.call({});
+ var o2 = new type();
+
+ assertPropertiesEqual(
+ Object.getOwnPropertyNames(o1),
+ Object.getOwnPropertyNames(o2)
+ );
+}
+
+// compare type.apply() and new type() own property names
+function testNoArgApplyAndNewOwnPropertyNames(type) {
+ var o1 = type.apply({});
+ var o2 = new type();
+
+ assertPropertiesEqual(
+ Object.getOwnPropertyNames(o1),
+ Object.getOwnPropertyNames(o2)
+ );
+}
+
+for (var t = 0; t < types.length; t++) {
+ testNoArgCallApply(types[t]);
+ testNoArgCallAndNewOwnPropertyNames(types[t]);
+ testNoArgApplyAndNewOwnPropertyNames(types[t]);
+}
« no previous file with comments | « src/d8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698