Assume ES5+ built-ins exist.

This commit is contained in:
John-David Dalton
2017-01-09 19:06:04 -08:00
parent 8501b0c2ef
commit 8bc7e006db
26 changed files with 18 additions and 117 deletions

View File

@@ -1,5 +1,4 @@
import constant from './constant.js';
import defineProperty from './_defineProperty.js';
import identity from './identity.js';
/**
@@ -10,11 +9,13 @@ import identity from './identity.js';
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
const baseSetToString = !defineProperty ? identity : (func, string) => defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
function baseSetToString(func, string){
return Object.defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
'value': constant(string),
'writable': true
});
}
export default baseSetToString;