11 lines
472 B
JavaScript
11 lines
472 B
JavaScript
|
'use strict';
|
||
|
var toPropertyKey = require('../internals/to-property-key');
|
||
|
var definePropertyModule = require('../internals/object-define-property');
|
||
|
var createPropertyDescriptor = require('../internals/create-property-descriptor');
|
||
|
|
||
|
module.exports = function (object, key, value) {
|
||
|
var propertyKey = toPropertyKey(key);
|
||
|
if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
||
|
else object[propertyKey] = value;
|
||
|
};
|