Bug 1523785: Add "flat" and "flatMap" to Array.prototype[@@unscopables]. r=jorendorff
authorAndré Bargull <andre.bargull@gmail.com>
Mon, 18 Feb 2019 06:51:32 -0800
changeset 519522 fa45218ad1c585bb3882807b833c539cd07f76fc
parent 519521 8d678e501c5abb55bd58ec76fc8a1caa9d62615c
child 519523 4339eeddc19dde44ebd77022a8df74cb41377d6b
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1523785
milestone67.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 1523785: Add "flat" and "flatMap" to Array.prototype[@@unscopables]. r=jorendorff
js/src/builtin/Array.cpp
js/src/tests/non262/Array/unscopables.js
js/src/vm/CommonPropertyNames.h
--- a/js/src/builtin/Array.cpp
+++ b/js/src/builtin/Array.cpp
@@ -3936,16 +3936,18 @@ static bool array_proto_finish(JSContext
   }
 
   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) ||
       !DefineDataProperty(cx, unscopables, cx->names().findIndex, value) ||
+      !DefineDataProperty(cx, unscopables, cx->names().flat, value) ||
+      !DefineDataProperty(cx, unscopables, cx->names().flatMap, value) ||
       !DefineDataProperty(cx, unscopables, cx->names().includes, value) ||
       !DefineDataProperty(cx, unscopables, cx->names().keys, value) ||
       !DefineDataProperty(cx, unscopables, cx->names().values, value)) {
     return false;
   }
 
   RootedId id(cx, SYMBOL_TO_JSID(
                       cx->wellKnownSymbols().get(JS::SymbolCode::unscopables)));
--- a/js/src/tests/non262/Array/unscopables.js
+++ b/js/src/tests/non262/Array/unscopables.js
@@ -21,16 +21,18 @@ assertDeepEq(desc2, {
 let keys = Reflect.ownKeys(Array_unscopables);
 print(uneval(keys));
 assertDeepEq(keys, [
     "copyWithin",
     "entries",
     "fill",
     "find",
     "findIndex",
+    "flat",
+    "flatMap",
     "includes",
     "keys",
     "values"
 ]);
 
 for (let key of keys)
     assertEq(Array_unscopables[key], true);
 
--- a/js/src/vm/CommonPropertyNames.h
+++ b/js/src/vm/CommonPropertyNames.h
@@ -138,16 +138,18 @@
   MACRO(fileName, fileName, "fileName")                                        \
   MACRO(fill, fill, "fill")                                                    \
   MACRO(finally, finally_, "finally")                                          \
   MACRO(find, find, "find")                                                    \
   MACRO(findIndex, findIndex, "findIndex")                                     \
   MACRO(firstDayOfWeek, firstDayOfWeek, "firstDayOfWeek")                      \
   MACRO(fix, fix, "fix")                                                       \
   MACRO(flags, flags, "flags")                                                 \
+  MACRO(flat, flat, "flat")                                                    \
+  MACRO(flatMap, flatMap, "flatMap")                                           \
   MACRO(float32, float32, "float32")                                           \
   MACRO(Float32x4, Float32x4, "Float32x4")                                     \
   MACRO(float64, float64, "float64")                                           \
   MACRO(Float64x2, Float64x2, "Float64x2")                                     \
     MACRO(for, for_, "for")                                                    \
   MACRO(forceInterpreter, forceInterpreter, "forceInterpreter")                \
   MACRO(forEach, forEach, "forEach")                                           \
   MACRO(format, format, "format")                                              \