| 198 | } |
| 199 | |
| 200 | void 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 | |
| 220 | Local<Value> CreateExternalWinRTObject(const char* ns, |
| 221 | const char* objectName, |