Skip to content

Commit

Permalink
[New] shim/auto: add at to Symbol.unscopables
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 11, 2022
1 parent 9c1bb77 commit 7d9840f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"dependencies": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
"es-abstract": "^1.19.1"
"es-abstract": "^1.19.1",
"es-shim-unscopables": "^1.0.0"
},
"auto-changelog": {
"output": "CHANGELOG.md",
Expand Down
6 changes: 6 additions & 0 deletions shim.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
'use strict';

var define = require('define-properties');
var shimUnscopables = require('es-shim-unscopables');

var getPolyfill = require('./polyfill');

module.exports = function shimArrayPrototypeAt() {
var polyfill = getPolyfill();

define(
Array.prototype,
{ at: polyfill },
{ at: function () { return Array.prototype.at !== polyfill; } }
);

shimUnscopables('at');

return polyfill;
};

0 comments on commit 7d9840f

Please sign in to comment.