mirror of
https://gitea.com/actions/setup-python.git
synced 2024-11-22 18:19:35 +01:00
23 lines
641 B
JavaScript
23 lines
641 B
JavaScript
|
var constant = require('./constant'),
|
||
|
defineProperty = require('./_defineProperty'),
|
||
|
identity = require('./identity');
|
||
|
|
||
|
/**
|
||
|
* 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 = !defineProperty ? identity : function(func, string) {
|
||
|
return defineProperty(func, 'toString', {
|
||
|
'configurable': true,
|
||
|
'enumerable': false,
|
||
|
'value': constant(string),
|
||
|
'writable': true
|
||
|
});
|
||
|
};
|
||
|
|
||
|
module.exports = baseSetToString;
|