mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
21 lines
805 B
JavaScript
21 lines
805 B
JavaScript
var DESCRIPTORS = require('../internals/descriptors');
|
|
var IE8_DOM_DEFINE = require('../internals/ie8-dom-define');
|
|
var anObject = require('../internals/an-object');
|
|
var toPrimitive = require('../internals/to-primitive');
|
|
|
|
var nativeDefineProperty = Object.defineProperty;
|
|
|
|
// `Object.defineProperty` method
|
|
// https://tc39.github.io/ecma262/#sec-object.defineproperty
|
|
exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
|
anObject(O);
|
|
P = toPrimitive(P, true);
|
|
anObject(Attributes);
|
|
if (IE8_DOM_DEFINE) try {
|
|
return nativeDefineProperty(O, P, Attributes);
|
|
} catch (error) { /* empty */ }
|
|
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
return O;
|
|
};
|