see https://github.com/rvagg/nan/pull/145
This is a patch what i found just now, and i think this is a bug in nan
because in https://github.com/rvagg/nan/blob/master/nan.h#L1469 it returns,
but https://github.com/rvagg/nan/blob/master/nan.h#L828 doesn't.

Of course `NanReturnUndefined` should work well, but once this patch has
been merged by nan team, I wanna create a new patch for `v8-profiler`.


On Thu, Jun 5, 2014 at 6:10 PM, 3y3 <notifications@github.com> wrote:

> In src/cpu_profiler.cc:
>
> > +    NanAssignPersistent(Profile::profiles, profiles);
> > +    target->Set(NanNew<String>("cpu"), cpuProfiler);
> > +  }
> > +
> > +  NAN_METHOD(CpuProfiler::StartProfiling) {
> > +    NanScope();
> > +
> > +    bool recsamples = false;
> > +    Local<String> title = NanNew<String>("");
> > +    if (args.Length()) {
> > +      if (args.Length()>1) {
> > +        if (args[1]->IsBoolean()) {
> > +          recsamples = args[1]->ToBoolean()->Value();
> > +        } else if (!args[1]->IsUndefined()) {
> > +          NanThrowTypeError("Wrong argument [1] type (wait Boolean)");
> > +          NanReturnUndefined();
>
> Correct me, but I think that NanThrowTypeError don't return from function.
> I also can't do this return NanThrowTypeError bacause this is not
> Handle<Value>
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/node-inspector/v8-profiler/pull/39/files#r13432423>.
>