Bug 697515 - WeakMap.set should return undefined, not itself. r=jorendorff.

This commit is contained in:
Stephan Herhut
2011-10-26 14:25:20 -05:00
parent dd368857f7
commit bddf70a113
3 changed files with 8 additions and 1 deletions

View File

@@ -223,9 +223,9 @@ WeakMap_set(JSContext *cx, uintN argc, Value *vp)
obj->setPrivate(map);
}
args.thisv() = UndefinedValue();
if (!map->put(key, value))
goto out_of_memory;
args.rval().setUndefined();
return true;
out_of_memory: