mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Simplify setProperty.
This commit is contained in:
@@ -32,11 +32,9 @@
|
|||||||
<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;
|
|
||||||
return function(object, key, value) {
|
|
||||||
try {
|
try {
|
||||||
_defineProperty(object, key, {
|
Object.defineProperty(object, key, {
|
||||||
'configurable': true,
|
'configurable': true,
|
||||||
'enumerable': false,
|
'enumerable': false,
|
||||||
'writable': true,
|
'writable': true,
|
||||||
@@ -46,8 +44,7 @@
|
|||||||
object[key] = value;
|
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