Merge MC -> JM
This commit is contained in:
@@ -78,6 +78,14 @@ WeakMapBase::sweepAll(JSTracer *tracer)
|
||||
m->sweep(tracer);
|
||||
}
|
||||
|
||||
void
|
||||
WeakMapBase::traceAllMappings(WeakMapTracer *tracer)
|
||||
{
|
||||
JSRuntime *rt = tracer->context->runtime;
|
||||
for (WeakMapBase *m = rt->gcWeakMapList; m; m = m->next)
|
||||
m->traceMappings(tracer);
|
||||
}
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
typedef WeakMap<HeapPtr<JSObject>, HeapValue> ObjectValueMap;
|
||||
@@ -215,7 +223,7 @@ WeakMap_set(JSContext *cx, uintN argc, Value *vp)
|
||||
|
||||
ObjectValueMap *map = GetObjectMap(obj);
|
||||
if (!map) {
|
||||
map = cx->new_<ObjectValueMap>(cx);
|
||||
map = cx->new_<ObjectValueMap>(cx, obj);
|
||||
if (!map->init()) {
|
||||
cx->delete_(map);
|
||||
goto out_of_memory;
|
||||
|
||||
Reference in New Issue
Block a user