Files
lodash/_baseSetToString.js
John-David Dalton 94ac73824f Bump to v4.16.0.
2016-09-17 22:28:43 -07:00

23 lines
663 B
JavaScript

import constant from './constant.js';
import identity from './identity.js';
import nativeDefineProperty from './_nativeDefineProperty.js';
/**
* The base implementation of `setToString` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to modify.
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
var baseSetToString = !nativeDefineProperty ? identity : function(func, string) {
return nativeDefineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
};
export default baseSetToString;