| Index: test/mjsunit/harmony/collections.js
|
| diff --git a/test/mjsunit/harmony/collections.js b/test/mjsunit/harmony/collections.js
|
| index 174d3d1dc7ca772c86e388e8de68f786b9022e08..a3d1ca8f26566422da120374330c03ede82781e2 100644
|
| --- a/test/mjsunit/harmony/collections.js
|
| +++ b/test/mjsunit/harmony/collections.js
|
| @@ -304,6 +304,20 @@ TestPrototype(WeakMap);
|
| TestPrototype(WeakSet);
|
|
|
|
|
| +// Test that constructor can be called only on appropriate objects only once.
|
| +function TestConstructorBehavior(C) {
|
| + var obj = new C();
|
| + assertThrows(function() { C.call(obj); }, TypeError);
|
| + assertThrows(function() { C.call({}); }, TypeError);
|
| + var uninitObj = %NewObject(C);
|
| + C.call(uninitObj); // shouldn't throw
|
| +}
|
| +TestConstructorBehavior(Set);
|
| +TestConstructorBehavior(Map);
|
| +TestConstructorBehavior(WeakMap);
|
| +TestConstructorBehavior(WeakSet);
|
| +
|
| +
|
| // Test constructor property of the Set, Map, WeakMap and WeakSet prototype.
|
| function TestConstructor(C) {
|
| assertFalse(C === Object.prototype.constructor);
|
| @@ -483,4 +497,4 @@ for (var i = 9; i >= 0; i--) {
|
| assertTrue(w.has(k));
|
| w.clear();
|
| assertFalse(w.has(k));
|
| -})();
|
| +})();
|
|
|