Bug 1092538 - Ignore null iterable in Map, Set, WeakMap and WeakSet constructors. r=evilpie

This commit is contained in:
Tooru Fujisawa
2014-11-29 20:57:27 +09:00
parent f86b5f0616
commit 9ff2510008
10 changed files with 20 additions and 13 deletions

View File

@@ -527,7 +527,7 @@ WeakMap_construct(JSContext *cx, unsigned argc, Value *vp)
return false;
// ES6 23.3.1.1 steps 5-6, 11.
if (args.hasDefined(0)) {
if (!args.get(0).isNullOrUndefined()) {
// Steps 7d-e.
JS::ForOfIterator iter(cx);
if (!iter.init(args[0]))