| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@joyeecheung build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/2011/pipeline |
Sorry, something went wrong.
There was a problem hiding this comment.
Btw, I’ve also thought about creating a static array from the macro here, instead of generating the full code for each entry… that might make things a bit easier as well?
Sorry, something went wrong.
I don't think I follow..what do you mean by creating a static array? |
Sorry, something went wrong.
|
@joyeecheung This might not compile because I wrote it here in Github, but I think you get the idea: static const struct {
int value;
const char* name;
const char* message;
} errors[] = {
#define V(name, msg) { UV_##name, #name, msg },
UV_ERRNO_MAP(V)
#undef V
{ 0, nullptr, nullptr }
};
for (const auto* error = errors; error->name != nullptr; error++) {
Local<Value> arr[] = {
OneByteString(isolate, error->name),
OneByteString(isolate, error->msg)
};
if (err_map->Set(context,
Integer::New(isolate, error->value),
Array::New(isolate, arr, arraysize(arr))).IsEmpty()) {
return;
}
}
The major advantage would probably be that the code isn’t several kilobytes large in this case. No strong feelings about it, though :) |
Sorry, something went wrong.
This removes the `internalBinding('uv')` call from the normal
bootstrap for now, and avoids building `errmap` by default which
expands to a lot of calls into V8.
This removes the `internalBinding('uv')` call from the normal
bootstrap for now, and avoids building `errmap` by default which
expands to a lot of calls into V8.
PR-URL: #25143
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This removes the `internalBinding('uv')` call from the normal
bootstrap for now, and avoids building `errmap` by default which
expands to a lot of calls into V8.
PR-URL: #25143
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This removes the `internalBinding('uv')` call from the normal
bootstrap for now, and avoids building `errmap` by default which
expands to a lot of calls into V8.
PR-URL: nodejs#25143
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
| Back | FazBrowse Home | New Git URL |
This removes the internalBinding('uv') call from the normal
bootstrap for now, and avoids building errmap by default which
expands to a lot of calls into V8.
Checklist