Reviewers: rossberg,

Message:
Followup to https://codereview.chromium.org/448013005/

Description:
WeakMap/WeakSet: Add test for non object keys

Add test for non object keys in the iterable passed to the constructor.

BUG=v8:3399
LOG=Y

Please review this at https://codereview.chromium.org/451033003/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+14, -0 lines):
  M test/mjsunit/es6/collections.js


Index: test/mjsunit/es6/collections.js
diff --git a/test/mjsunit/es6/collections.js b/test/mjsunit/es6/collections.js index 1e2f232ee814fa002397175d816b3c7c9472561b..c58571950c9545861dfa9d99e8ac25ebde8913d4 100644
--- a/test/mjsunit/es6/collections.js
+++ b/test/mjsunit/es6/collections.js
@@ -1141,6 +1141,13 @@ TestSetConstructorNextNotAnObject(Set);
 TestSetConstructorNextNotAnObject(WeakSet);


+(function TestWeakSetConstructorNonObjectKeys() {
+  assertThrows(function() {
+    new WeakSet([1]);
+  }, TypeError);
+})();
+
+
 function TestMapConstructor(ctor) {
   var m = new ctor(null);
   assertSize(0, m);
@@ -1286,3 +1293,10 @@ function TestMapConstructorIteratorNotObjectValues(ctor) {
 }
 TestMapConstructorIteratorNotObjectValues(Map);
 TestMapConstructorIteratorNotObjectValues(WeakMap);
+
+
+(function TestWeakMapConstructorNonObjectKeys() {
+  assertThrows(function() {
+    new WeakMap([[1, 2]])
+  }, TypeError);
+})();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to