main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
925 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var DESCRIPTORS = require('../internals/descriptors');
|
---|
3 | var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');
|
---|
4 | var definePropertyModule = require('../internals/object-define-property');
|
---|
5 | var anObject = require('../internals/an-object');
|
---|
6 | var toIndexedObject = require('../internals/to-indexed-object');
|
---|
7 | var objectKeys = require('../internals/object-keys');
|
---|
8 |
|
---|
9 | // `Object.defineProperties` method
|
---|
10 | // https://tc39.es/ecma262/#sec-object.defineproperties
|
---|
11 | // eslint-disable-next-line es/no-object-defineproperties -- safe
|
---|
12 | exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
---|
13 | anObject(O);
|
---|
14 | var props = toIndexedObject(Properties);
|
---|
15 | var keys = objectKeys(Properties);
|
---|
16 | var length = keys.length;
|
---|
17 | var index = 0;
|
---|
18 | var key;
|
---|
19 | while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
---|
20 | return O;
|
---|
21 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.