Bug 975412 - Fix length properties of Map and Set constructors. r=jorendorff

This commit is contained in:
Sankha Narayan Guria 2014-02-21 21:17:22 +05:30
parent e53280194e
commit a0392d812e
3 changed files with 3 additions and 3 deletions

View File

@ -1048,7 +1048,7 @@ InitClass(JSContext *cx, Handle<GlobalObject*> global, const Class *clasp, JSPro
return nullptr;
proto->setPrivate(nullptr);
Rooted<JSFunction*> ctor(cx, global->createConstructor(cx, construct, ClassName(key, cx), 1));
Rooted<JSFunction*> ctor(cx, global->createConstructor(cx, construct, ClassName(key, cx), 0));
if (!ctor ||
!LinkConstructorAndPrototype(cx, ctor, proto) ||
!DefinePropertiesAndBrand(cx, proto, properties, methods) ||

View File

@ -9,7 +9,7 @@ assertEq(desc.writable, true);
assertEq(typeof Map, 'function');
assertEq(Object.keys(Map).length, 0);
assertEq(Map.length, 1);
assertEq(Map.length, 0);
assertEq(Map.name, "Map");
assertEq(Object.getPrototypeOf(Map.prototype), Object.prototype);

View File

@ -9,7 +9,7 @@ assertEq(desc.writable, true);
assertEq(typeof Set, 'function');
assertEq(Object.keys(Set).length, 0);
assertEq(Set.length, 1);
assertEq(Set.length, 0);
assertEq(Set.name, "Set");
assertEq(Object.getPrototypeOf(Set.prototype), Object.prototype);