@@ -363,7 +363,7 @@ LabelSetsByNode WallProfiler::GetLabelSetsByNode(CpuProfile* profile,
363363 return labelSetsByNode;
364364 }
365365 sampleContext = contexts.pop_front ();
366- break ; // don't match more than one context to one sample
366+ break ; // don't match more than one context to one sample
367367 }
368368 }
369369 }
@@ -373,8 +373,6 @@ LabelSetsByNode WallProfiler::GetLabelSetsByNode(CpuProfile* profile,
373373 return labelSetsByNode;
374374}
375375
376- static Nan::Persistent<v8::Function> constructor;
377-
378376WallProfiler::WallProfiler (int intervalMicros, int durationMicros)
379377 : samplingInterval(intervalMicros),
380378 contexts(durationMicros * 2 / intervalMicros) {}
@@ -438,7 +436,7 @@ NAN_METHOD(WallProfiler::New) {
438436 return Nan::ThrowTypeError (" Sample rate must be a number." );
439437 }
440438
441- if (!info[0 ]->IsNumber ()) {
439+ if (!info[1 ]->IsNumber ()) {
442440 return Nan::ThrowTypeError (" Duration must be a number." );
443441 }
444442
@@ -464,8 +462,8 @@ NAN_METHOD(WallProfiler::New) {
464462 obj->Wrap (info.This ());
465463 info.GetReturnValue ().Set (info.This ());
466464 } else {
467- const int argc = 1 ;
468- v8::Local<v8::Value> argv[argc] = {info[0 ]};
465+ const int argc = 2 ;
466+ v8::Local<v8::Value> argv[argc] = {info[0 ], info[ 1 ] };
469467 v8::Local<v8::Function> cons = Nan::New (
470468 PerIsolateData::For (info.GetIsolate ())->WallProfilerConstructor ());
471469 info.GetReturnValue ().Set (
0 commit comments