Bug 990787, part 8 - Add an OOM check in WeakMap_set_impl. r=Waldo.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user