| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
You can improve on this with a map macro:
#define VALUE_METHOD_MAP(V) \
V(isArrayBuffer, IsArrayBuffer) \
V(isDataView, IsDataView) \
// etc.Then:
#define V(_, ucname) \
static void ucname(const FunctionCallbackInfo<Value>& args) { \
// etc.
VALUE_METHOD_MAP(V)
#undef VAnd further down below:
#define V(lcname, ucname) env->SetMethod(target, #lcname, ucname);
VALUE_METHOD_MAP(V)
#undef V
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
Marking this as an LTS watch but I'm not convinced yet we should land it there. |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
Sorry, something went wrong.
The Is* type checking functions in node_util.cc are mostly the same boilerplate. This commit defines them using a macro. Refs: nodejs#4100 PR-URL: nodejs#4118 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
The Is* type checking functions in node_util.cc are mostly the same boilerplate. This commit defines them using a macro. Refs: nodejs#4100 PR-URL: nodejs#4118 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Conflicts: src/node_util.cc
The Is* type checking functions in node_util.cc are mostly the same boilerplate. This commit defines them using a macro. Refs: nodejs#4100 PR-URL: nodejs#4118 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
The Is* type checking functions in node_util.cc are mostly the same boilerplate. This commit defines them using a macro.
Refs: #4100
R=@bnoordhuis