| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e6ecc13 commit dfdf742
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ function isError(e) { | |||
| 35 | 35 | ||
| 36 | 36 | // Keep a list of deprecation codes that have been warned on so we only warn on | |
| 37 | 37 | // each one once. | |
| 38 | - const codesWarned = {}; | ||
| 38 | + const codesWarned = new Set(); | ||
| 39 | 39 | ||
| 40 | 40 | // Mark that a method should not be used. | |
| 41 | 41 | // Returns a modified function which warns once by default. | |
@@ -53,9 +53,9 @@ function deprecate(fn, msg, code) { | |||
| 53 | 53 | if (!warned) { | |
| 54 | 54 | warned = true; | |
| 55 | 55 | if (code !== undefined) { | |
| 56 | - if (!codesWarned[code]) { | ||
| 56 | + if (!codesWarned.has(code)) { | ||
| 57 | 57 | process.emitWarning(msg, 'DeprecationWarning', code, deprecated); | |
| 58 | - codesWarned[code] = true; | ||
| 58 | + codesWarned.add(code); | ||
| 59 | 59 | } | |
| 60 | 60 | } else { | |
| 61 | 61 | process.emitWarning(msg, 'DeprecationWarning', deprecated); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments