File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -2224,11 +2224,28 @@ added: v0.9.12
22242224
22252225* {boolean}
22262226
2227- The ` process.throwDeprecation ` property indicates whether the
2228- ` --throw-deprecation ` flag is set on the current Node.js process. See the
2227+ The initial value of ` process.throwDeprecation ` indicates whether the
2228+ ` --throw-deprecation ` flag is set on the current Node.js process.
2229+ ` process.throwDeprecation ` is mutable, so whether or not deprecation
2230+ warnings result in errors may be altered at runtime. See the
22292231documentation for the [ ` 'warning' ` event] [ process_warning ] and the
2230- [ ` emitWarning() ` method] [ process_emit_warning ] for more information about this
2231- flag's behavior.
2232+ [ ` emitWarning() ` method] [ process_emit_warning ] for more information.
2233+
2234+ ``` console
2235+ $ node --throw-deprecation -p " process.throwDeprecation"
2236+ true
2237+ $ node -p " process.throwDeprecation"
2238+ undefined
2239+ $ node
2240+ > process.emitWarning(' test' , ' DeprecationWarning' );
2241+ undefined
2242+ > (node:26598) DeprecationWarning: test
2243+ > process.throwDeprecation = true ;
2244+ true
2245+ > process.emitWarning(' test' , ' DeprecationWarning' );
2246+ Thrown:
2247+ { [DeprecationWarning: test] name: 'DeprecationWarning' }
2248+ ```
22322249
22332250## process.title
22342251<!-- YAML
You can’t perform that action at this time.
0 commit comments