From a0392d812ea859be67f7372123c6182c32e33821 Mon Sep 17 00:00:00 2001 From: Sankha Narayan Guria Date: Fri, 21 Feb 2014 21:17:22 +0530 Subject: [PATCH] Bug 975412 - Fix length properties of Map and Set constructors. r=jorendorff --- js/src/builtin/MapObject.cpp | 2 +- js/src/jit-test/tests/collections/Map-surfaces-1.js | 2 +- js/src/jit-test/tests/collections/Set-surfaces-1.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/src/builtin/MapObject.cpp b/js/src/builtin/MapObject.cpp index 004a4882e4bb..023e08878093 100644 --- a/js/src/builtin/MapObject.cpp +++ b/js/src/builtin/MapObject.cpp @@ -1048,7 +1048,7 @@ InitClass(JSContext *cx, Handle global, const Class *clasp, JSPro return nullptr; proto->setPrivate(nullptr); - Rooted ctor(cx, global->createConstructor(cx, construct, ClassName(key, cx), 1)); + Rooted ctor(cx, global->createConstructor(cx, construct, ClassName(key, cx), 0)); if (!ctor || !LinkConstructorAndPrototype(cx, ctor, proto) || !DefinePropertiesAndBrand(cx, proto, properties, methods) || diff --git a/js/src/jit-test/tests/collections/Map-surfaces-1.js b/js/src/jit-test/tests/collections/Map-surfaces-1.js index 254ad0312ca8..9931e7c49bc3 100644 --- a/js/src/jit-test/tests/collections/Map-surfaces-1.js +++ b/js/src/jit-test/tests/collections/Map-surfaces-1.js @@ -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); diff --git a/js/src/jit-test/tests/collections/Set-surfaces-1.js b/js/src/jit-test/tests/collections/Set-surfaces-1.js index bee9b78a8f03..73cac4c1a313 100644 --- a/js/src/jit-test/tests/collections/Set-surfaces-1.js +++ b/js/src/jit-test/tests/collections/Set-surfaces-1.js @@ -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);