-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: do not access process.noDeprecation at build time #51447
Conversation
Can you add a test ? |
108f05b
to
2d08652
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test ?
@targos I don't think we can reliably test this because this requires accessing something that we are not supposed to access in the snapshot i.e. before the test is run. |
Delay access at run time otherwise the value is captured at build time and always false.
2d08652
to
3160cfe
Compare
function emitRecursiveRmdirWarning() { | ||
if (recursiveRmdirWarned === undefined) { | ||
// TODO(joyeecheung): use getOptionValue('--no-deprecation') instead. | ||
recursiveRmdirWarned = process.noDeprecation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recursiveRmdirWarned = recursiveRmdirWarned || process.noDeprecation;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would make the code harder to understand when we are lazily initializing a boolean.
#51813 failed across multiple PRs. |
Landed in 9ac98b1 |
Delay access at run time otherwise the value is captured at build time and always false. PR-URL: #51447 Reviewed-By: Jithil P Ponnan <jithil@outlook.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Delay access at run time otherwise the value is captured at build time and always false. PR-URL: #51447 Reviewed-By: Jithil P Ponnan <jithil@outlook.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Delay access at run time otherwise the value is captured at build time and always false. PR-URL: #51447 Reviewed-By: Jithil P Ponnan <jithil@outlook.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Delay access at run time otherwise the value is captured at build time and always false. PR-URL: #51447 Reviewed-By: Jithil P Ponnan <jithil@outlook.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Delay access at run time otherwise the value is captured at build time and always false. PR-URL: #51447 Reviewed-By: Jithil P Ponnan <jithil@outlook.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Delay access at run time otherwise the value is captured at build time and always false. PR-URL: nodejs#51447 Reviewed-By: Jithil P Ponnan <jithil@outlook.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Delay access at run time otherwise the value is captured at build time and always false.