Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
769 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-preventextensions -- safe
|
---|
| 8 | var $preventExtensions = Object.preventExtensions;
|
---|
| 9 | var FAILS_ON_PRIMITIVES = fails(function () { $preventExtensions(1); });
|
---|
| 10 |
|
---|
| 11 | // `Object.preventExtensions` method
|
---|
| 12 | // https://tc39.es/ecma262/#sec-object.preventextensions
|
---|
| 13 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
---|
| 14 | preventExtensions: function preventExtensions(it) {
|
---|
| 15 | return $preventExtensions && isObject(it) ? $preventExtensions(onFreeze(it)) : it;
|
---|
| 16 | }
|
---|
| 17 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.