MCPcopy
hub / github.com/lodash/lodash / setProperty

Function setProperty

test/test.js:475–487  ·  view source on GitHub ↗

* Sets a non-enumerable property value on `object`. * * Note: This function is used to avoid a bug in older versions of V8 where * overwriting non-enumerable built-ins makes them enumerable. * See https://code.google.com/p/v8/issues/detail?id=1623 * * @private * @param {Object}

(object, key, value)

Source from the content-addressed store, hash-verified

473 * @param {*} value The property value.
474 */
475 function setProperty(object, key, value) {
476 try {
477 defineProperty(object, key, {
478 'configurable': true,
479 'enumerable': false,
480 'writable': true,
481 'value': value
482 });
483 } catch (e) {
484 object[key] = value;
485 }
486 return object;
487 }
488
489 /**
490 * Skips a given number of tests with a passing result.

Callers 1

test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected