main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
639 bytes
|
Line | |
---|
1 | import constant from './constant.js';
|
---|
2 | import defineProperty from './_defineProperty.js';
|
---|
3 | import identity from './identity.js';
|
---|
4 |
|
---|
5 | /**
|
---|
6 | * The base implementation of `setToString` without support for hot loop shorting.
|
---|
7 | *
|
---|
8 | * @private
|
---|
9 | * @param {Function} func The function to modify.
|
---|
10 | * @param {Function} string The `toString` result.
|
---|
11 | * @returns {Function} Returns `func`.
|
---|
12 | */
|
---|
13 | var baseSetToString = !defineProperty ? identity : function(func, string) {
|
---|
14 | return defineProperty(func, 'toString', {
|
---|
15 | 'configurable': true,
|
---|
16 | 'enumerable': false,
|
---|
17 | 'value': constant(string),
|
---|
18 | 'writable': true
|
---|
19 | });
|
---|
20 | };
|
---|
21 |
|
---|
22 | export default baseSetToString;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.