UNPKG

well-known-symbols

Version:

An ESnext spec-compliant shim/polyfill/replacement for all Well-Known Symbols that works in any environment with Symbols.

23 lines (16 loc) 426 B
'use strict'; var GetIntrinsic = require('get-intrinsic'); var oDP = GetIntrinsic('%Object.defineProperty%', true); var getPolyfill = require('./polyfill'); module.exports = function shimDispose() { var polyfill = getPolyfill(); if (polyfill && polyfill !== Symbol.dispose) { oDP(Symbol, 'dispose', { configurable: false, enumerable: false, value: polyfill, writable: false }); } return polyfill; };