-
Notifications
You must be signed in to change notification settings - Fork 30k
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
src: add READONLY_STRING_PROPERTY and simplify config #22222
Conversation
Bit of tidying up where we set different config values..
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.
LGTM but can we fast track this? I like it, but it’s, like, very directly conflicting with what I’m working on at this point. 😄
src/node_config.cc
Outdated
@@ -29,6 +29,18 @@ using v8::Value; | |||
True(isolate), ReadOnly).FromJust(); \ | |||
} while (0) | |||
|
|||
#define READONLY_STRING_PROPERTY(obj, str, val) \ | |||
do { \ | |||
obj->DefineOwnProperty(context, \ |
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.
It’s a best practice to parenthesize macro parameters, i.e. use (obj)->DefineOwnProperty(…)
, even if this is probably not an issue for now :)
src/node_config.cc
Outdated
String::NewFromUtf8( \ | ||
isolate, \ | ||
val.data(), \ | ||
v8::NewStringType::kNormal).ToLocalChecked(), \ |
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.
tiny nit: 4 spaces for statement continuations
Landed in 30b5b84 |
Bit of tidying up where we set different config values. PR-URL: #22222 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
Bit of tidying up where we set different config values. PR-URL: #22222 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
Bit of tidying up where we set different config values.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes