* @return {!{[key: string]: !{[key: string]: Function}}} * @private
()
| 31 | * @private |
| 32 | */ |
| 33 | function generateFunctionAllowlist() { |
| 34 | /** |
| 35 | * Deprecated. Static, not-in-place variant of Array#splice. |
| 36 | * @param {!Array} array |
| 37 | * @param {number=} unusedStart |
| 38 | * @param {number=} unusedDeleteCount |
| 39 | * @param {...?} unusedItems |
| 40 | * @return {!Array} |
| 41 | */ |
| 42 | function splice(array, unusedStart, unusedDeleteCount, unusedItems) { |
| 43 | if (!isArray(array)) { |
| 44 | throw new Error(`splice: ${array} is not an array.`); |
| 45 | } |
| 46 | const copy = Array.prototype.slice.call(array); |
| 47 | const args = Array.prototype.slice.call(arguments, 1); |
| 48 | Array.prototype.splice.apply(copy, args); |
| 49 | return copy; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Needs to be wrapped to avoid a duplicate name conflict with the deprecated |
| 54 | * splice function above. |
| 55 | * @return {!Function} |
| 56 | */ |
| 57 | function instanceSplice() { |
| 58 | /** |
| 59 | * @param {number=} unusedStart |
| 60 | * @param {number=} unusedDeleteCount |
| 61 | * @param {...?} unusedItems |
| 62 | * @return {!Array} |
| 63 | * @this {!Array} |
| 64 | */ |
| 65 | function splice(unusedStart, unusedDeleteCount, unusedItems) { |
| 66 | const copy = Array.prototype.slice.call(this); |
| 67 | Array.prototype.splice.apply(copy, arguments); |
| 68 | return copy; |
| 69 | } |
| 70 | return splice; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Deprecated. Static, not-in-place variant of Array#sort. |
| 75 | * @param {!Array} array |
| 76 | * @return {!Array} |
| 77 | */ |
| 78 | function sort(array) { |
| 79 | if (!isArray(array)) { |
| 80 | throw new Error(`sort: ${array} is not an array.`); |
| 81 | } |
| 82 | const copy = Array.prototype.slice.call(array); |
| 83 | Array.prototype.sort.call(copy); |
| 84 | return copy; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Needs to be wrapped to avoid a duplicate name conflict with the deprecated |
| 89 | * sort function above. |
| 90 | * @return {!Function} |
no test coverage detected