GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — module: remove unnecessary JSON.stringify by zertosh · Pull Request #3578 · nodejs/node

Conversation

@zertosh

@zertosh zertosh commented Oct 29, 2015

Copy link
Copy Markdown
Contributor

Use debulog's placeholder replacement %j for stringification. So calls to JSON.stringify are only made by debuglog when you're actually debugging. Also, made the remaining calls to debuglog consistent with this style.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@MylesBorins

MylesBorins commented Oct 29, 2015

Copy link
Copy Markdown
Contributor

could template strings have a similar result?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig

cjihrig commented Oct 29, 2015

Copy link
Copy Markdown
Contributor

LGTM. It's simpler to read too. I think template strings would suffer the same problem as the original code (stringification even when not debugging).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zertosh

zertosh commented Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

For the %s, yes – for the %j, no. %j is the perf win here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex mscdex added the module Issues and PRs related to the module subsystem. label Oct 29, 2015
thefourtheye
thefourtheye reviewed Oct 29, 2015
View reviewed changes
Comment thread lib/module.js Outdated

@thefourtheye thefourtheye Oct 29, 2015

Copy link
Copy Markdown
Contributor

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.

Style nit: this should align with the previous line's parameter

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@zertosh zertosh Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

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.

Done!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@zertosh
module: remove unnecessary JSON.stringify
7c7f131
`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.
@thefourtheye

thefourtheye commented Oct 29, 2015

Copy link
Copy Markdown
Contributor

LGTM with a style nit

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented Oct 29, 2015

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Oct 29, 2015

Copy link
Copy Markdown
Member

LGTM but since this touches module we may want more @nodejs/ctc review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris

trevnorris commented Oct 29, 2015

Copy link
Copy Markdown
Contributor

I generally hate how we handle debug() in core anyway, but this is a nice perf win. LGTM.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zertosh zertosh mentioned this pull request Oct 31, 2015
module: move unnecessary work for early return #3579
Closed
@zertosh

zertosh commented Oct 31, 2015

Copy link
Copy Markdown
Contributor Author

Seems like everyone is Ok on this. Merge?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented Nov 5, 2015

Copy link
Copy Markdown
Contributor

@jasnell am I good to land this or do we want to get CTC review?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig

cjihrig commented Nov 5, 2015

Copy link
Copy Markdown
Contributor

I think 3 CTC LGTMs and 2 more from collaborators should be sufficient.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig

cjihrig commented Nov 5, 2015

Copy link
Copy Markdown
Contributor

Although, has CI been run?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented Nov 5, 2015

Copy link
Copy Markdown
Contributor

Good catch. CI: https://ci.nodejs.org/job/node-test-pull-request/674/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 5, 2015

Copy link
Copy Markdown
Member

+1 :)
On Nov 5, 2015 6:38 AM, "Colin Ihrig" [email protected] wrote:

I think 3 CTC LGTMs and 2 more from collaborators should be sufficient.

—
Reply to this email directly or view it on GitHub
#3578 (comment).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell pushed a commit that referenced this pull request Nov 5, 2015
@zertosh @jasnell
module: remove unnecessary JSON.stringify
faa3bb8
`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.

PR-URL: #3578
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@jasnell

jasnell commented Nov 5, 2015

Copy link
Copy Markdown
Member

CI was green. Landed in faa3bb8

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell closed this Nov 5, 2015
@jasnell jasnell added the lts-watch-v4.x label Nov 5, 2015
@Fishrock123 Fishrock123 mentioned this pull request Nov 6, 2015
Release proposal: v5.1.0 #3700
Closed
rvagg pushed a commit that referenced this pull request Nov 7, 2015
@zertosh @rvagg
module: remove unnecessary JSON.stringify
89285db
`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.

PR-URL: #3578
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@Fishrock123 Fishrock123 mentioned this pull request Nov 11, 2015
Propose v5.1.0 #3736
Merged
MylesBorins pushed a commit that referenced this pull request Nov 16, 2015
@zertosh Myles Borins
module: remove unnecessary JSON.stringify
948af71
`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.

PR-URL: #3578
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@MylesBorins

MylesBorins commented Nov 16, 2015

Copy link
Copy Markdown
Contributor

landed in lts-v4.x-staging as 948af71

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MylesBorins MylesBorins added lts-landed-on-v4.x and removed lts-watch-v4.x labels Nov 16, 2015
@rvagg rvagg mentioned this pull request Nov 17, 2015
v4.2.2+1 commit candidates nodejs/Release#57
Closed
rvagg pushed a commit that referenced this pull request Dec 4, 2015
@zertosh @rvagg
module: remove unnecessary JSON.stringify
27085bf
`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.

PR-URL: #3578
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@MylesBorins MylesBorins added land-on-v4.x and removed lts-landed-on-v4.x labels Dec 17, 2015
@jasnell jasnell mentioned this pull request Dec 17, 2015
Release 4.2.4 Planning #4321
Closed
jasnell pushed a commit that referenced this pull request Dec 17, 2015
@zertosh @jasnell
module: remove unnecessary JSON.stringify
d80fa2c
`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.

PR-URL: #3578
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
jasnell pushed a commit that referenced this pull request Dec 23, 2015
@zertosh @jasnell
module: remove unnecessary JSON.stringify
5086a9c
`debuglog` uses `%j` as a placeholder for replacement with
`JSON.stringify`. So that `JSON.stringify` is only called when the
appropriate debug flag is on. The other `%s` changes are for style
consistency.

PR-URL: #3578
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
This was referenced Dec 7, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/alisco-node#1140
Open
[Snyk] Security upgrade karma from 5.2.3 to 6.0.0 aliscco/alisco-node#1146
Open
[Snyk] Security upgrade karma from 5.2.3 to 6.0.0 aliscco/alisco-node#1156
Open
@leonardoadame leonardoadame mentioned this pull request Dec 8, 2023
[Snyk] Fix for 1 vulnerabilities leonardoadame/node#567
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

module Issues and PRs related to the module subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@zertosh @MylesBorins @cjihrig @thefourtheye @evanlucas @jasnell @trevnorris @mscdex
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.