@@ -542,7 +542,6 @@ NAN_MODULE_INIT(WallProfiler::Init) {
542542 Nan::SetPrototypeMethod (tpl, " start" , Start);
543543 Nan::SetPrototypeMethod (tpl, " dispose" , Dispose);
544544 Nan::SetPrototypeMethod (tpl, " stop" , Stop);
545- Nan::SetPrototypeMethod (tpl, " unsetLabels" , UnsetLabels);
546545
547546 PerIsolateData::For (Isolate::GetCurrent ())
548547 ->WallProfilerConstructor ()
@@ -571,11 +570,11 @@ v8::Local<v8::Value> WallProfiler::GetLabels(Isolate* isolate) {
571570}
572571
573572void 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+ }
579578}
580579
581580NAN_GETTER (WallProfiler::GetLabels) {
@@ -588,11 +587,6 @@ NAN_SETTER(WallProfiler::SetLabels) {
588587 profiler->SetLabels (info.GetIsolate (), value);
589588}
590589
591- NAN_METHOD (WallProfiler::UnsetLabels) {
592- auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder ());
593- profiler->UnsetLabels ();
594- }
595-
596590NAN_GETTER (WallProfiler::GetLabelsCaptured) {
597591 auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder ());
598592 info.GetReturnValue ().Set (profiler->GetLabelsCaptured ());
0 commit comments