Commit 6c209206 authored by arv@chromium.org's avatar arv@chromium.org

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
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/451033003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23090 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5ae2276f
......@@ -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);
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment