source: trip-planner-front/node_modules/core-js/modules/es.reflect.define-property.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1var $ = require('../internals/export');
2var DESCRIPTORS = require('../internals/descriptors');
3var anObject = require('../internals/an-object');
4var toPropertyKey = require('../internals/to-property-key');
5var definePropertyModule = require('../internals/object-define-property');
6var fails = require('../internals/fails');
7
8// MS Edge has broken Reflect.defineProperty - throwing instead of returning false
9var ERROR_INSTEAD_OF_FALSE = fails(function () {
10 // eslint-disable-next-line es/no-reflect -- required for testing
11 Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 });
12});
13
14// `Reflect.defineProperty` method
15// https://tc39.es/ecma262/#sec-reflect.defineproperty
16$({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS }, {
17 defineProperty: function defineProperty(target, propertyKey, attributes) {
18 anObject(target);
19 var key = toPropertyKey(propertyKey);
20 anObject(attributes);
21 try {
22 definePropertyModule.f(target, key, attributes);
23 return true;
24 } catch (error) {
25 return false;
26 }
27 }
28});
Note: See TracBrowser for help on using the repository browser.