Skip to content

Commit

Permalink
[harmony] Add flat/flatMap to Array.prototype[Symbol.unscopables]
Browse files Browse the repository at this point in the history
tc39/proposal-flatMap#74
tc39/proposal-flatMap#75

BUG=v8:7220

Change-Id: I93ce66bddbb429beaa7486311f120ec32d6a35fb
Reviewed-on: https://chromium-review.googlesource.com/c/1390125
Reviewed-by: Benedikt Meurer <[email protected]>
Commit-Queue: Mathias Bynens <[email protected]>
Cr-Commit-Position: refs/heads/master@{#58537}
  • Loading branch information
mathiasbynens authored and Commit Bot committed Jan 4, 2019
1 parent b57f89f commit 2142822
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bootstrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,8 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> 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");
Expand Down
4 changes: 4 additions & 0 deletions test/mjsunit/es6/unscopables.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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);
Expand Down

0 comments on commit 2142822

Please sign in to comment.