-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: move version metadata into node_metadata{.h, .cc} #24774
Conversation
Move these macros to util.h so they can be shared among different C++ files. Also, renames `READONLY_BOOLEAN_PROPERTY` to `READONLY_TRUE_PROPERTY` (since it sets the property to true), and use `ToV8Value` in `READONLY_STRING_PROPERTY`.
This patch moves the computation of version metadata from node.cc into node_metadata{.h, .cc}, and creates a macro that can be used to iterate over the available version keys (v8, uv, .etc). This makes the code clearer as now we no longer need to add all the headers in node.cc just to compute the versions, and makes it easier to reuse the version definitions.
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.
Nice!
node.gyp
Outdated
@@ -370,6 +370,7 @@ | |||
'src/node_url.cc', | |||
'src/node_util.cc', | |||
'src/node_v8.cc', | |||
'src/node_metadata.cc', |
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.
Oops, should've sort these
@mmarchini BTW, it should be possible to make these directly available as post-mortem metadata that can be consumed by llnode, same goes for the other recent additions like node_binding.cc and node_native_module.cc, maybe we should design some common interface/macros to do this.. |
Landed in ff7d053...d17d7bd |
Move these macros to util.h so they can be shared among different C++ files. Also, renames `READONLY_BOOLEAN_PROPERTY` to `READONLY_TRUE_PROPERTY` (since it sets the property to true), and use `ToV8Value` in `READONLY_STRING_PROPERTY`. PR-URL: nodejs#24774 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This patch moves the computation of version metadata from node.cc into node_metadata{.h, .cc}, and creates a macro that can be used to iterate over the available version keys (v8, uv, .etc). This makes the code clearer as now we no longer need to add all the headers in node.cc just to compute the versions, and makes it easier to reuse the version definitions. PR-URL: nodejs#24774 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Move these macros to util.h so they can be shared among different C++ files. Also, renames `READONLY_BOOLEAN_PROPERTY` to `READONLY_TRUE_PROPERTY` (since it sets the property to true), and use `ToV8Value` in `READONLY_STRING_PROPERTY`. PR-URL: #24774 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This patch moves the computation of version metadata from node.cc into node_metadata{.h, .cc}, and creates a macro that can be used to iterate over the available version keys (v8, uv, .etc). This makes the code clearer as now we no longer need to add all the headers in node.cc just to compute the versions, and makes it easier to reuse the version definitions. PR-URL: #24774 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Move these macros to util.h so they can be shared among different C++ files. Also, renames `READONLY_BOOLEAN_PROPERTY` to `READONLY_TRUE_PROPERTY` (since it sets the property to true), and use `ToV8Value` in `READONLY_STRING_PROPERTY`. PR-URL: nodejs#24774 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This patch moves the computation of version metadata from node.cc into node_metadata{.h, .cc}, and creates a macro that can be used to iterate over the available version keys (v8, uv, .etc). This makes the code clearer as now we no longer need to add all the headers in node.cc just to compute the versions, and makes it easier to reuse the version definitions. PR-URL: nodejs#24774 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
src: move READONLY_* macros into util.h
Move these macros to util.h so they can be shared among different
C++ files.
Also, renames
READONLY_BOOLEAN_PROPERTY
toREADONLY_TRUE_PROPERTY
(since it sets the property to true), and use
ToV8Value
inREADONLY_STRING_PROPERTY
.src: move version metadata into node_metadata{.h, .cc}
This patch moves the computation of version metadata from node.cc
into node_metadata{.h, .cc}, and creates a macro that can be
used to iterate over the available version keys (v8, uv, .etc).
This makes the code clearer as now we no longer need to add
all the headers in node.cc just to compute the versions, and
makes it easier to reuse the version definitions.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes