MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / RegisterNameSpace

Function RegisterNameSpace

src/NodeRTLib/ProjectFiles/NodeRtUtils.cpp:200–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void RegisterNameSpace(const char* ns, Local<Value> nsExports) {
201 HandleScope scope;
202 Local<Object> global = Nan::GetCurrentContext()->Global();
203
204 if (!Nan::Has(global,
205 Nan::New<String>("__winRtNamespaces__").ToLocalChecked())
206 .FromMaybe(false)) {
207 Nan::ForceSet(global,
208 Nan::New<String>("__winRtNamespaces__").ToLocalChecked(),
209 Nan::New<Object>(),
210 (v8::PropertyAttribute)(v8::PropertyAttribute::DontEnum &
211 v8::PropertyAttribute::DontDelete));
212 }
213
214 MaybeLocal<Value> nsObject = Nan::Get(
215 global, Nan::New<String>("__winRtNamespaces__").ToLocalChecked());
216 Nan::Set(Nan::To<Object>(nsObject.ToLocalChecked()).ToLocalChecked(),
217 Nan::New<String>(ns).ToLocalChecked(), nsExports);
218}
219
220Local<Value> CreateExternalWinRTObject(const char* ns,
221 const char* objectName,

Callers 1

NAN_MODULE_INITFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected