| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d90594a commit 9082cc5
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -859,8 +859,12 @@ const validateRmOptionsSync = hideStackFrames((path, options, expectDir) => { | |||
| 859 | 859 | return options; | |
| 860 | 860 | }); | |
| 861 | 861 | ||
| 862 | - let recursiveRmdirWarned = process.noDeprecation; | ||
| 862 | + let recursiveRmdirWarned; | ||
| 863 | 863 | function emitRecursiveRmdirWarning() { | |
| 864 | + if (recursiveRmdirWarned === undefined) { | ||
| 865 | + // TODO(joyeecheung): use getOptionValue('--no-deprecation') instead. | ||
| 866 | + recursiveRmdirWarned = process.noDeprecation; | ||
| 867 | + } | ||
| 864 | 868 | if (!recursiveRmdirWarned) { | |
| 865 | 869 | process.emitWarning( | |
| 866 | 870 | 'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -142,10 +142,6 @@ function pendingDeprecate(fn, msg, code) { | |||
| 142 | 142 | // Returns a modified function which warns once by default. | |
| 143 | 143 | // If --no-deprecation is set, then it is a no-op. | |
| 144 | 144 | function deprecate(fn, msg, code, useEmitSync) { | |
| 145 | - if (process.noDeprecation === true) { | ||
| 146 | - return fn; | ||
| 147 | - } | ||
| 148 | - | ||
| 149 | 145 | // Lazy-load to avoid a circular dependency. | |
| 150 | 146 | if (validateString === undefined) | |
| 151 | 147 | ({ validateString } = require('internal/validators')); | |
@@ -158,7 +154,10 @@ function deprecate(fn, msg, code, useEmitSync) { | |||
| 158 | 154 | ); | |
| 159 | 155 | ||
| 160 | 156 | function deprecated(...args) { | |
| 161 | - emitDeprecationWarning(); | ||
| 157 | + // TODO(joyeecheung): use getOptionValue('--no-deprecation') instead. | ||
| 158 | + if (!process.noDeprecation) { | ||
| 159 | + emitDeprecationWarning(); | ||
| 160 | + } | ||
| 162 | 161 | if (new.target) { | |
| 163 | 162 | return ReflectConstruct(fn, args, new.target); | |
| 164 | 163 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments