Skip to content

Commit bd64aff

Browse files
committed
[New] shim/auto: add flatMap to Symbol.unscopables
1 parent 3ba7820 commit bd64aff

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"dependencies": {
4949
"call-bind": "^1.0.2",
5050
"define-properties": "^1.1.3",
51-
"es-abstract": "^1.19.2"
51+
"es-abstract": "^1.19.2",
52+
"es-shim-unscopables": "^1.0.0"
5253
},
5354
"devDependencies": {
5455
"@es-shims/api": "^2.2.3",

shim.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
'use strict';
22

33
var define = require('define-properties');
4+
var shimUnscopables = require('es-shim-unscopables');
5+
46
var getPolyfill = require('./polyfill');
57

68
module.exports = function shimFlatMap() {
79
var polyfill = getPolyfill();
10+
811
define(
912
Array.prototype,
1013
{ flatMap: polyfill },
1114
{ flatMap: function () { return Array.prototype.flatMap !== polyfill; } }
1215
);
16+
17+
shimUnscopables('flatMap');
18+
1319
return polyfill;
1420
};

0 commit comments

Comments
 (0)