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:
659 bytes
|
Line | |
---|
1 | var $ = require('../internals/export');
|
---|
2 | var getBuiltIn = require('../internals/get-built-in');
|
---|
3 | var anObject = require('../internals/an-object');
|
---|
4 | var FREEZING = require('../internals/freezing');
|
---|
5 |
|
---|
6 | // `Reflect.preventExtensions` method
|
---|
7 | // https://tc39.es/ecma262/#sec-reflect.preventextensions
|
---|
8 | $({ target: 'Reflect', stat: true, sham: !FREEZING }, {
|
---|
9 | preventExtensions: function preventExtensions(target) {
|
---|
10 | anObject(target);
|
---|
11 | try {
|
---|
12 | var objectPreventExtensions = getBuiltIn('Object', 'preventExtensions');
|
---|
13 | if (objectPreventExtensions) objectPreventExtensions(target);
|
---|
14 | return true;
|
---|
15 | } catch (error) {
|
---|
16 | return false;
|
---|
17 | }
|
---|
18 | }
|
---|
19 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.