mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Simplify setProperty.
This commit is contained in:
@@ -32,22 +32,19 @@
|
|||||||
<div id="exports"></div>
|
<div id="exports"></div>
|
||||||
<div id="module"></div>
|
<div id="module"></div>
|
||||||
<script>
|
<script>
|
||||||
var setProperty = (function() {
|
function setProperty(object, key, value) {
|
||||||
var _defineProperty = Object.defineProperty;
|
try {
|
||||||
return function(object, key, value) {
|
Object.defineProperty(object, key, {
|
||||||
try {
|
'configurable': true,
|
||||||
_defineProperty(object, key, {
|
'enumerable': false,
|
||||||
'configurable': true,
|
'writable': true,
|
||||||
'enumerable': false,
|
'value': value
|
||||||
'writable': true,
|
});
|
||||||
'value': value
|
} catch (e) {
|
||||||
});
|
object[key] = value;
|
||||||
} catch(e) {
|
}
|
||||||
object[key] = value;
|
return object;
|
||||||
}
|
}
|
||||||
return object;
|
|
||||||
};
|
|
||||||
}());
|
|
||||||
|
|
||||||
function addBizarroMethods() {
|
function addBizarroMethods() {
|
||||||
var funcProto = Function.prototype,
|
var funcProto = Function.prototype,
|
||||||
|
|||||||
Reference in New Issue
Block a user