mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1055472 - Part 11: Make the WeakMap constructor properly subclassable. (r=Waldo)
This commit is contained in:
parent
5745b31e40
commit
89fb3dc021
@ -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;
|
||||
|
||||
|
@ -34,6 +34,7 @@ testBuiltin(RegExp, /Regexp Argument/);
|
||||
testBuiltin(RegExp, "String Argument");
|
||||
testBuiltin(Map);
|
||||
testBuiltin(Set);
|
||||
testBuiltin(WeakMap);
|
||||
|
||||
`;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user