aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/_object-dp.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/core-js/modules/_object-dp.js')
-rw-r--r--node_modules/core-js/modules/_object-dp.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/node_modules/core-js/modules/_object-dp.js b/node_modules/core-js/modules/_object-dp.js
new file mode 100644
index 00000000..0340a830
--- /dev/null
+++ b/node_modules/core-js/modules/_object-dp.js
@@ -0,0 +1,16 @@
+var anObject = require('./_an-object');
+var IE8_DOM_DEFINE = require('./_ie8-dom-define');
+var toPrimitive = require('./_to-primitive');
+var dP = Object.defineProperty;
+
+exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {
+ anObject(O);
+ P = toPrimitive(P, true);
+ anObject(Attributes);
+ if (IE8_DOM_DEFINE) try {
+ return dP(O, P, Attributes);
+ } catch (e) { /* empty */ }
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
+ if ('value' in Attributes) O[P] = Attributes.value;
+ return O;
+};