Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
module: remove unnecessary JSON.stringify#3578
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
MylesBorins commented Oct 29, 2015
could template strings have a similar result? |
cjihrig commented Oct 29, 2015
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). |
zertosh commented Oct 29, 2015
For the |
lib/module.js Outdated
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
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!
`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 commented Oct 29, 2015
LGTM with a style nit |
evanlucas commented Oct 29, 2015
LGTM |
jasnell commented Oct 29, 2015
LGTM but since this touches module we may want more @nodejs/ctc review. |
trevnorris commented Oct 29, 2015
I generally hate how we handle |
zertosh commented Oct 31, 2015
Seems like everyone is Ok on this. Merge? |
evanlucas commented Nov 5, 2015
@jasnell am I good to land this or do we want to get CTC review? |
cjihrig commented Nov 5, 2015
I think 3 CTC LGTMs and 2 more from collaborators should be sufficient. |
cjihrig commented Nov 5, 2015
Although, has CI been run? |
evanlucas commented Nov 5, 2015
Good catch. CI: https://ci.nodejs.org/job/node-test-pull-request/674/ |
jasnell commented Nov 5, 2015
+1 :)
|
`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 commented Nov 5, 2015
CI was green. Landed in 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]>
`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 commented Nov 16, 2015
landed in lts-v4.x-staging as 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]>
`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]>
`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]>
Use
debulog's placeholder replacement%jfor stringification. So calls toJSON.stringifyare only made bydebuglogwhen you're actually debugging. Also, made the remaining calls todebuglogconsistent with this style.