0

Nan 1.x had a function NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>) to check whether an object is an instance of a constructor. However, that function was removed in nan 2.0, and there isn't an obvious replacement. Does nan still expose this functionality in some other way? If not, is there some other way to check it that is compatible across Node versions?

ZachB
  • 13,051
  • 4
  • 61
  • 89
murgatroid99
  • 19,007
  • 10
  • 60
  • 95

1 Answers1

2

You can port it with that cool bash script by Thorsten Lorenz.

But basically the signature is

Nan::New(\\1)->HasInstance(\\2)

Or in v8 I think it's here

eljefedelrodeodeljefe
  • 6,304
  • 7
  • 29
  • 61