()
| 203 | 'Buffer.allocUnsafe(), or Buffer.from() methods instead.'; |
| 204 | |
| 205 | function showFlaggedDeprecation() { |
| 206 | if (bufferWarningAlreadyEmitted || |
| 207 | ++nodeModulesCheckCounter > 10000 || |
| 208 | (!require('internal/options').getOptionValue('--pending-deprecation') && |
| 209 | isInsideNodeModules(3))) { |
| 210 | // We don't emit a warning, because we either: |
| 211 | // - Already did so, or |
| 212 | // - Already checked too many times whether a call is coming |
| 213 | // from node_modules and want to stop slowing down things, or |
| 214 | // - We aren't running with `--pending-deprecation` enabled, |
| 215 | // and the code is inside `node_modules`. |
| 216 | // - If the topmost non-internal frame is not inside `node_modules`. |
| 217 | return; |
| 218 | } |
| 219 | |
| 220 | process.emitWarning(bufferWarning, 'DeprecationWarning', 'DEP0005'); |
| 221 | bufferWarningAlreadyEmitted = true; |
| 222 | } |
| 223 | |
| 224 | function toInteger(n, defaultVal) { |
| 225 | n = +n; |
no test coverage detected
searching dependent graphs…