Bug 1055472 - Part 11: Make the WeakMap constructor properly subclassable. (r=Waldo)

This commit is contained in:
Eric Faust 2015-11-13 18:22:21 -08:00
parent 5745b31e40
commit 89fb3dc021
2 changed files with 3 additions and 1 deletions

View File

@ -316,7 +316,8 @@ WeakMap_construct(JSContext* cx, unsigned argc, Value* vp)
if (!ThrowIfNotConstructing(cx, args, "WeakMap"))
return false;
RootedObject obj(cx, NewBuiltinClassInstance(cx, &WeakMapObject::class_));
RootedObject newTarget(cx, &args.newTarget().toObject());
RootedObject obj(cx, CreateThis(cx, &WeakMapObject::class_, newTarget));
if (!obj)
return false;

View File

@ -34,6 +34,7 @@ testBuiltin(RegExp, /Regexp Argument/);
testBuiltin(RegExp, "String Argument");
testBuiltin(Map);
testBuiltin(Set);
testBuiltin(WeakMap);
`;