massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / es.object.freeze.js
1 var $ = require('../internals/export');
2 var FREEZING = require('../internals/freezing');
3 var fails = require('../internals/fails');
4 var isObject = require('../internals/is-object');
5 var onFreeze = require('../internals/internal-metadata').onFreeze;
6
7 // eslint-disable-next-line es/no-object-freeze -- safe
8 var $freeze = Object.freeze;
9 var FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); });
10
11 // `Object.freeze` method
12 // https://tc39.es/ecma262/#sec-object.freeze
13 $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
14   freeze: function freeze(it) {
15     return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;
16   }
17 });