Skip to content

Commit dd14f45

Browse files
committed
[New] shim/auto: add flat to Symbol.unscopables
1 parent c22629d commit dd14f45

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"dependencies": {
5050
"call-bind": "^1.0.2",
5151
"define-properties": "^1.1.3",
52-
"es-abstract": "^1.19.2"
52+
"es-abstract": "^1.19.2",
53+
"es-shim-unscopables": "^1.0.0"
5354
},
5455
"devDependencies": {
5556
"@es-shims/api": "^2.2.3",

shim.js

+6
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 shimFlat() {
79
var polyfill = getPolyfill();
10+
811
define(
912
Array.prototype,
1013
{ flat: polyfill },
1114
{ flat: function () { return Array.prototype.flat !== polyfill; } }
1215
);
16+
17+
shimUnscopables('flat');
18+
1319
return polyfill;
1420
};

0 commit comments

Comments
 (0)