| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 821951e commit 8fd316f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,8 @@ const kArrowMessagePrivateSymbolIndex = binding['arrow_message_private_symbol']; | |||
| 10 | 10 | const kDecoratedPrivateSymbolIndex = binding['decorated_private_symbol']; | |
| 11 | 11 | const noCrypto = !process.versions.openssl; | |
| 12 | 12 | ||
| 13 | + const experimentalWarnings = new Set(); | ||
| 14 | + | ||
| 13 | 15 | function isError(e) { | |
| 14 | 16 | return objectToString(e) === '[object Error]' || e instanceof Error; | |
| 15 | 17 | } | |
@@ -115,6 +117,14 @@ function normalizeEncoding(enc) { | |||
| 115 | 117 | } | |
| 116 | 118 | } | |
| 117 | 119 | ||
| 120 | + function emitExperimentalWarning(feature) { | ||
| 121 | + if (experimentalWarnings.has(feature)) return; | ||
| 122 | + const msg = `${feature} is an experimental feature. This feature could ` + | ||
| 123 | + 'change at any time'; | ||
| 124 | + experimentalWarnings.add(feature); | ||
| 125 | + process.emitWarning(msg, 'ExperimentalWarning'); | ||
| 126 | + } | ||
| 127 | + | ||
| 118 | 128 | function filterDuplicateStrings(items, low) { | |
| 119 | 129 | const map = new Map(); | |
| 120 | 130 | for (var i = 0; i < items.length; i++) { | |
@@ -285,6 +295,7 @@ module.exports = { | |||
| 285 | 295 | createClassWrapper, | |
| 286 | 296 | decorateErrorStack, | |
| 287 | 297 | deprecate, | |
| 298 | + emitExperimentalWarning, | ||
| 288 | 299 | filterDuplicateStrings, | |
| 289 | 300 | getConstructorOf, | |
| 290 | 301 | isError, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments