(fn, msg, code)
| 155 | // at snapshot building time as the warning permission is only queried at |
| 156 | // run time. |
| 157 | function pendingDeprecate(fn, msg, code) { |
| 158 | const emitDeprecationWarning = getDeprecationWarningEmitter( |
| 159 | code, msg, deprecated, false, isPendingDeprecation, |
| 160 | ); |
| 161 | function deprecated(...args) { |
| 162 | emitDeprecationWarning(); |
| 163 | return ReflectApply(fn, this, args); |
| 164 | } |
| 165 | |
| 166 | ObjectDefineProperty(deprecated, 'length', { |
| 167 | __proto__: null, |
| 168 | ...ObjectGetOwnPropertyDescriptor(fn, 'length'), |
| 169 | }); |
| 170 | |
| 171 | return deprecated; |
| 172 | } |
| 173 | |
| 174 | // Mark that a method should not be used. |
| 175 | // Returns a modified function which warns once by default. |
no test coverage detected