From 214282249f022c74cb47a5485aaceb64d965d95d Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Mon, 24 Dec 2018 15:13:08 +0100 Subject: [PATCH] [harmony] Add flat/flatMap to Array.prototype[Symbol.unscopables] https://github.com/tc39/proposal-flatMap/issues/74 https://github.com/tc39/proposal-flatMap/pull/75 BUG=v8:7220 Change-Id: I93ce66bddbb429beaa7486311f120ec32d6a35fb Reviewed-on: https://chromium-review.googlesource.com/c/1390125 Reviewed-by: Benedikt Meurer Commit-Queue: Mathias Bynens Cr-Commit-Position: refs/heads/master@{#58537} --- src/bootstrapper.cc | 2 ++ test/mjsunit/es6/unscopables.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 9c4b492182dd..1901926661a7 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -1776,6 +1776,8 @@ void Genesis::InitializeGlobal(Handle global_object, InstallTrueValuedProperty(isolate_, unscopables, "fill"); InstallTrueValuedProperty(isolate_, unscopables, "find"); InstallTrueValuedProperty(isolate_, unscopables, "findIndex"); + InstallTrueValuedProperty(isolate_, unscopables, "flat"); + InstallTrueValuedProperty(isolate_, unscopables, "flatMap"); InstallTrueValuedProperty(isolate_, unscopables, "includes"); InstallTrueValuedProperty(isolate_, unscopables, "keys"); InstallTrueValuedProperty(isolate_, unscopables, "values"); diff --git a/test/mjsunit/es6/unscopables.js b/test/mjsunit/es6/unscopables.js index 782dd2d7a36d..99573a96ab50 100644 --- a/test/mjsunit/es6/unscopables.js +++ b/test/mjsunit/es6/unscopables.js @@ -96,6 +96,8 @@ function TestArrayPrototypeUnscopables() { var fill = 'local fill'; var find = 'local find'; var findIndex = 'local findIndex'; + var flat = 'local flat'; + var flatMap = 'local flatMap'; var keys = 'local keys'; var values = 'local values'; @@ -108,6 +110,8 @@ function TestArrayPrototypeUnscopables() { assertEquals('local fill', fill); assertEquals('local find', find); assertEquals('local findIndex', findIndex); + assertEquals('local flat', flat); + assertEquals('local flatMap', flatMap); assertEquals('local keys', keys); assertEquals('local values', values); assertEquals(42, toString);