Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
639 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var $ = require('../internals/export');
|
---|
| 2 | var isObject = require('../internals/is-object');
|
---|
| 3 | var onFreeze = require('../internals/internal-metadata').onFreeze;
|
---|
| 4 | var FREEZING = require('../internals/freezing');
|
---|
| 5 | var fails = require('../internals/fails');
|
---|
| 6 |
|
---|
| 7 | // eslint-disable-next-line es/no-object-seal -- safe
|
---|
| 8 | var $seal = Object.seal;
|
---|
| 9 | var FAILS_ON_PRIMITIVES = fails(function () { $seal(1); });
|
---|
| 10 |
|
---|
| 11 | // `Object.seal` method
|
---|
| 12 | // https://tc39.es/ecma262/#sec-object.seal
|
---|
| 13 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
---|
| 14 | seal: function seal(it) {
|
---|
| 15 | return $seal && isObject(it) ? $seal(onFreeze(it)) : it;
|
---|
| 16 | }
|
---|
| 17 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.