-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVOIDescription.cpp
More file actions
35 lines (23 loc) · 970 Bytes
/
VOIDescription.cpp
File metadata and controls
35 lines (23 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "VOIDescription.h"
#include "imebra.hpp"
#include "Arguments.hpp"
Nan::Persistent<v8::Function> VOIDescription::constructor;
VOIDescription::VOIDescription() {
}
void VOIDescription::Init(v8::Local<v8::Object> exports) {
auto tpl = Nan::New<v8::FunctionTemplate>(New);
tpl->InstanceTemplate()->SetInternalFieldCount(1);
tpl->SetClassName(Nan::New("VOIDescription").ToLocalChecked());
Nan::SetPrototypeMethod(tpl,"getDescription",GetDescription);
constructor.Reset(Nan::GetFunction(tpl).ToLocalChecked());
Nan::Set(exports,Nan::New("VOIDescription").ToLocalChecked(),Nan::GetFunction(tpl).ToLocalChecked());
}
NAN_METHOD(VOIDescription::New) {
auto* d = new VOIDescription();
d->Wrap(info.This());
info.GetReturnValue().Set(info.This());
}
NAN_METHOD(VOIDescription::GetDescription) {
UNWRAP(info.This(),VOIDescription,v);
info.GetReturnValue().Set(Nan::New(v->value.getDescription()).ToLocalChecked());
}