Index: test/mjsunit/harmony/collections.js |
diff --git a/test/mjsunit/harmony/collections.js b/test/mjsunit/harmony/collections.js |
index 0219f39364d97a6859037a3f48de87dcefcd8ae3..f201628f9a999587f2f84f87f25a8aa90d17807e 100644 |
--- a/test/mjsunit/harmony/collections.js |
+++ b/test/mjsunit/harmony/collections.js |
@@ -25,7 +25,7 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --harmony-collections --expose-gc |
+// Flags: --harmony-collections --expose-gc --allow-natives-syntax |
// Test valid getter and setter calls on Sets. |
@@ -254,6 +254,24 @@ assertTrue(WeakMap.prototype.has instanceof Function) |
assertTrue(WeakMap.prototype.delete instanceof Function) |
+// Test type of the Set, Map and WeakMap prototype. |
rossberg
2013/04/11 13:15:14
"type" -> "class"
Also, you may want to add tests
Michael Starzinger
2013/04/11 13:31:28
Done.
|
+assertEquals("Object", %_ClassOf(Set.prototype)) |
+assertEquals("Object", %_ClassOf(Map.prototype)) |
+assertEquals("Object", %_ClassOf(WeakMap.prototype)) |
+ |
+ |
+// Test constructor property of the Set, Map and WeakMap prototype. |
+function TestConstructor(C) { |
+ assertFalse(C === Object.prototype.constructor); |
+ assertSame(C, C.prototype.constructor); |
+ assertSame(C, C().__proto__.constructor); |
+ assertSame(C, (new C).__proto__.constructor); |
+} |
+TestConstructor(Set); |
+TestConstructor(Map); |
+TestConstructor(WeakMap); |
+ |
+ |
// Regression test for WeakMap prototype. |
assertTrue(WeakMap.prototype.constructor === WeakMap) |
assertTrue(Object.getPrototypeOf(WeakMap.prototype) === Object.prototype) |