| 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]);
|
| +}
|
|
|