17 lines
647 B
JavaScript
17 lines
647 B
JavaScript
var DESCRIPTORS = require('../internals/descriptors');
|
|
var definePropertyModule = require('../internals/object-define-property');
|
|
var anObject = require('../internals/an-object');
|
|
var objectKeys = require('../internals/object-keys');
|
|
|
|
// `Object.defineProperties` method
|
|
// https://tc39.github.io/ecma262/#sec-object.defineproperties
|
|
module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
anObject(O);
|
|
var keys = objectKeys(Properties);
|
|
var length = keys.length;
|
|
var index = 0;
|
|
var key;
|
|
while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
|
|
return O;
|
|
};
|