/
githubmirror
/
amphtml
Обзор
Документация
Войти
/
githubmirror
/
amphtml
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/polyfills/map-set.js
23 строки
501 B
Kristofer Baxter
♻️ Remove Notice from JS and Markdown (#35717)
19 авг 2021, 21:21
Не верифицирован
19 авг 2021, 21:21
f564b7e
Код
Авторство
О чём код?
/** * Forces the return value from Map.prototype.set to always be the map * instance. IE11 returns undefined. * * @param {!Window} win */ export function install(win) { const {Map} = win; const m = new Map(); if (m.set(0, 0) !== m) { const {set} = m; win.Object.defineProperty(Map.prototype, 'set', { enumerable: false, configurable: true, writable: true, value: function () { set.apply(this, arguments); return this; }, }); } }