mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
FromJust() is often used not for its return value, but for its side-effects. In these cases, Check() exists, and is more clear as to the intent. From its comment: To be used, where the actual value of the Maybe is not needed, like Object::Set. See: https://github.com/nodejs/node/pull/26929/files#r269256335 PR-URL: https://github.com/nodejs/node/pull/27162 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
30 lines
810 B
C++
30 lines
810 B
C++
#include "env-inl.h"
|
|
#include "node_binding.h"
|
|
|
|
namespace node {
|
|
|
|
using v8::Context;
|
|
using v8::Local;
|
|
using v8::Object;
|
|
using v8::Value;
|
|
|
|
namespace symbols {
|
|
|
|
static void Initialize(Local<Object> target,
|
|
Local<Value> unused,
|
|
Local<Context> context,
|
|
void* priv) {
|
|
Environment* env = Environment::GetCurrent(context);
|
|
#define V(PropertyName, StringValue) \
|
|
target \
|
|
->Set(env->context(), env->PropertyName()->Name(), env->PropertyName()) \
|
|
.Check();
|
|
PER_ISOLATE_SYMBOL_PROPERTIES(V)
|
|
#undef V
|
|
}
|
|
|
|
} // namespace symbols
|
|
} // namespace node
|
|
|
|
NODE_MODULE_CONTEXT_AWARE_INTERNAL(symbols, node::symbols::Initialize)
|