Bug 1415489 - Use SingletonObject for Array.prototype[@@unscopables]. r=bhackett
authorJan de Mooij <jdemooij@mozilla.com>
Sat, 11 Nov 2017 13:32:56 +0100
changeset 444684 9b5afe75d13f7cf77c9766d0a75f0faabd83a090
parent 444683 d352680181fc5034f86fa7658ca2d49d87ad7f79
child 444685 e2dc5d006fc76e2e013d0d07a9707c20c2b3227c
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1415489
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1415489 - Use SingletonObject for Array.prototype[@@unscopables]. r=bhackett
js/src/jsarray.cpp
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -3668,17 +3668,18 @@ CreateArrayPrototype(JSContext* cx, JSPr
 
     return arrayProto;
 }
 
 static bool
 array_proto_finish(JSContext* cx, JS::HandleObject ctor, JS::HandleObject proto)
 {
     // Add Array.prototype[@@unscopables]. ECMA-262 draft (2016 Mar 19) 22.1.3.32.
-    RootedObject unscopables(cx, NewObjectWithGivenProto<PlainObject>(cx, nullptr, TenuredObject));
+    RootedObject unscopables(cx, NewObjectWithGivenProto<PlainObject>(cx, nullptr,
+                                                                      SingletonObject));
     if (!unscopables)
         return false;
 
     RootedValue value(cx, BooleanValue(true));
     if (!DefineDataProperty(cx, unscopables, cx->names().copyWithin, value) ||
         !DefineDataProperty(cx, unscopables, cx->names().entries, value) ||
         !DefineDataProperty(cx, unscopables, cx->names().fill, value) ||
         !DefineDataProperty(cx, unscopables, cx->names().find, value) ||