Skip to content
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

process: check env->EmitProcessEnvWarning() last #25575

Closed
wants to merge 1 commit into from

Conversation

bcoe
Copy link
Contributor

@bcoe bcoe commented Jan 18, 2019

Calling env->EmitProcessEnvWarning() prevents additional warnings from being set
it should therefore be called only if a warning will emit.

Split this work out from #25157, addressing @joyeecheung's concerns.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jan 18, 2019
@bcoe
Copy link
Contributor Author

bcoe commented Jan 18, 2019

@refack
Copy link
Contributor

refack commented Jan 19, 2019

Verified local that the test indeed fails without the patch:

DEV D:\code\prws>node.nightly20190114.exe --pending-deprecation test/parallel/test-process-env-deprecation.js
Mismatched <anonymous> function calls. Expected exactly 1, actual 0.
    at mustCall (D:\code\prws\test\common\index.js:344:10)
    at _expectWarning (D:\code\prws\test\common\index.js:514:10)
    at Object.expectWarning (D:\code\prws\test\common\index.js:534:31)
    at Object.<anonymous> (D:\code\prws\test\parallel\test-process-env-deprecation.js:7:8)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:621:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:564:12)
    at Function.Module._load (internal/modules/cjs/loader.js:556:3)

DEV D:\code\prws>"D:\code\temp\node25575.exe" --pending-deprecation test/parallel/test-process-env-deprecation.js
(node:12684) [DEP0104] DeprecationWarning: Assigning any value other than a string, number, or boolean to a process.env property is deprecated. Please make sure to convert the value to a string before setting process.env with it.

DEV D:\code\prws>echo %errorlevel%
0

@refack refack added process Issues and PRs related to the process subsystem. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Jan 19, 2019
@bcoe bcoe added the fast-track PRs that do not need to wait for 48 hours to land. label Jan 19, 2019
@bcoe
Copy link
Contributor Author

bcoe commented Jan 19, 2019

any objection to fast tracking this, would like to rebase #25157 against it.

@bcoe bcoe removed the fast-track PRs that do not need to wait for 48 hours to land. label Jan 19, 2019
@refack
Copy link
Contributor

refack commented Jan 19, 2019

IMO it's not a good fit for fast tracking. It changes code semantics in a nuanced way...
Also it need not block #25157 which can handle failing tests anyway.

Calling env->EmitProcessEnvWarning() prevents additional warnings
from being set it should therefore be called only if a warning will
emit.
@bcoe
Copy link
Contributor Author

bcoe commented Jan 21, 2019

Landed in 0b50972

@bcoe bcoe closed this Jan 21, 2019
@bcoe bcoe deleted the fix-process-warn branch January 21, 2019 18:30
bcoe added a commit that referenced this pull request Jan 21, 2019
Calling env->EmitProcessEnvWarning() prevents additional warnings
from being set it should therefore be called only if a warning will
emit.

PR-URL: #25575
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
addaleax pushed a commit that referenced this pull request Jan 23, 2019
Calling env->EmitProcessEnvWarning() prevents additional warnings
from being set it should therefore be called only if a warning will
emit.

PR-URL: #25575
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants