@@ -542,7 +542,6 @@ NAN_MODULE_INIT(WallProfiler::Init) {
542
542
Nan::SetPrototypeMethod (tpl, " start" , Start);
543
543
Nan::SetPrototypeMethod (tpl, " dispose" , Dispose);
544
544
Nan::SetPrototypeMethod (tpl, " stop" , Stop);
545
- Nan::SetPrototypeMethod (tpl, " unsetLabels" , UnsetLabels);
546
545
547
546
PerIsolateData::For (Isolate::GetCurrent ())
548
547
->WallProfilerConstructor ()
@@ -571,11 +570,11 @@ v8::Local<v8::Value> WallProfiler::GetLabels(Isolate* isolate) {
571
570
}
572
571
573
572
void WallProfiler::SetLabels (Isolate* isolate, Local<Value> value) {
574
- labels_ = std::make_shared<Global<Value>> (isolate, value);
575
- }
576
-
577
- void WallProfiler::UnsetLabels () {
578
- labels_. reset ();
573
+ if (value-> BooleanValue (isolate)) {
574
+ labels_ = std::make_shared<Global<Value>>(isolate, value);
575
+ } else {
576
+ labels_. reset ();
577
+ }
579
578
}
580
579
581
580
NAN_GETTER (WallProfiler::GetLabels) {
@@ -588,11 +587,6 @@ NAN_SETTER(WallProfiler::SetLabels) {
588
587
profiler->SetLabels (info.GetIsolate (), value);
589
588
}
590
589
591
- NAN_METHOD (WallProfiler::UnsetLabels) {
592
- auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder ());
593
- profiler->UnsetLabels ();
594
- }
595
-
596
590
NAN_GETTER (WallProfiler::GetLabelsCaptured) {
597
591
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder ());
598
592
info.GetReturnValue ().Set (profiler->GetLabelsCaptured ());
0 commit comments