Bug 1031632 - Make Map.prototype.set, WeakMap.prototype.set and Set.prototype.add chainable. r=till

This commit is contained in:
Rishab Arora
2014-07-03 22:55:26 +05:30
parent 28b903af7b
commit 4bbaeb1a1a
13 changed files with 38 additions and 19 deletions

View File

@@ -420,8 +420,10 @@ WeakMap_set_impl(JSContext *cx, CallArgs args)
Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
Rooted<WeakMapObject*> map(cx, &thisObj->as<WeakMapObject>());
args.rval().setUndefined();
return SetWeakMapEntryInternal(cx, map, key, value);
if (!SetWeakMapEntryInternal(cx, map, key, value))
return false;
args.rval().set(args.thisv());
return true;
}
static bool