Bug 1024250; r=billm
This commit is contained in:
@@ -271,10 +271,6 @@ WeakMap_get_impl(JSContext *cx, CallArgs args)
|
||||
|
||||
if (ObjectValueMap *map = args.thisv().toObject().as<WeakMapObject>().getMap()) {
|
||||
if (ObjectValueMap::Ptr ptr = map->lookup(key)) {
|
||||
// Read barrier to prevent an incorrectly gray value from escaping the
|
||||
// weak map. See the comment before UnmarkGrayChildren in gc/Marking.cpp
|
||||
ExposeValueToActiveJS(ptr->value().get());
|
||||
|
||||
args.rval().set(ptr->value());
|
||||
return true;
|
||||
}
|
||||
@@ -450,6 +446,7 @@ JS_NondeterministicGetWeakMapKeys(JSContext *cx, HandleObject objArg, MutableHan
|
||||
// Prevent GC from mutating the weakmap while iterating.
|
||||
AutoSuppressGC suppress(cx);
|
||||
for (ObjectValueMap::Base::Range r = map->all(); !r.empty(); r.popFront()) {
|
||||
JS::ExposeObjectToActiveJS(r.front().key());
|
||||
RootedObject key(cx, r.front().key());
|
||||
if (!cx->compartment()->wrap(cx, &key))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user