Skip to content

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

Closed
bcoe wants to merge 1 commit into
nodejs:masterfrom
bcoe:fix-process-warn
Closed

process: check env->EmitProcessEnvWarning() last#25575
bcoe wants to merge 1 commit into
nodejs:masterfrom
bcoe:fix-process-warn

Conversation

@bcoe

@bcoebcoe commented Jan 18, 2019

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Collaborator

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

bcoe commented Jan 18, 2019

Copy link
Copy Markdown
ContributorAuthor

@refack

Copy link
Copy Markdown
Contributor

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

@refackrefack 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
@bcoebcoe added the fast-track PRs that do not need to wait for 48 hours to land. label Jan 19, 2019
@bcoe

bcoe commented Jan 19, 2019

Copy link
Copy Markdown
ContributorAuthor

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

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

Copy link
Copy Markdown
Contributor

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.

@bcoebcoe closed this Jan 20, 2019
@bcoebcoe reopened this Jan 21, 2019
Calling env->EmitProcessEnvWarning() prevents additional warnings
from being set it should therefore be called only if a warning will
emit.
@bcoe

bcoe commented Jan 21, 2019

Copy link
Copy Markdown
ContributorAuthor

Landed in 0b50972

@bcoebcoe 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>
@MylesBorinsMylesBorins mentioned this pull request Jan 24, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs 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++.processIssues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@bcoe@nodejs-github-bot@refack@thefourtheye@addaleax@cjihrig@joyeecheung