[node] Output debug logs when a render test times out

This commit is contained in:
John Firebaugh
2015-10-28 11:58:42 -07:00
parent dd56e832b5
commit 014b517820
16 changed files with 80 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ NAN_MODULE_INIT(NodeMap::Init) {
Nan::SetPrototypeMethod(tpl, "load", Load);
Nan::SetPrototypeMethod(tpl, "render", Render);
Nan::SetPrototypeMethod(tpl, "release", Release);
Nan::SetPrototypeMethod(tpl, "dumpDebugLogs", DumpDebugLogs);
constructor.Reset(tpl->GetFunction());
Nan::Set(target, Nan::New("Map").ToLocalChecked(), tpl->GetFunction());
@@ -327,6 +328,14 @@ void NodeMap::release() {
map.reset(nullptr);
}
NAN_METHOD(NodeMap::DumpDebugLogs) {
auto nodeMap = Nan::ObjectWrap::Unwrap<NodeMap>(info.Holder());
if (!nodeMap->isValid()) return Nan::ThrowError(releasedMessage());
nodeMap->map->dumpDebugLogs();
info.GetReturnValue().SetUndefined();
}
////////////////////////////////////////////////////////////////////////////////////////////////
// Instance