Bug 990787, part 8 - Add an OOM check in WeakMap_set_impl. r=Waldo.

This commit is contained in:
Jason Orendorff
2014-04-08 12:35:19 -05:00
parent dcee557df6
commit 08e5b1ca23

View File

@@ -312,6 +312,8 @@ WeakMap_set_impl(JSContext *cx, CallArgs args)
ObjectValueMap *map = thisObj->as<WeakMapObject>().getMap();
if (!map) {
map = cx->new_<ObjectValueMap>(cx, thisObj.get());
if (!map)
return false;
if (!map->init()) {
js_delete(map);
JS_ReportOutOfMemory(cx);