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?
Asked
Active
Viewed 356 times
0

ZachB
- 13,051
- 4
- 61
- 89

murgatroid99
- 19,007
- 10
- 60
- 95
-
@AlanStokes Thank you. I was looking for that tag. – murgatroid99 Sep 16 '15 at 19:53
1 Answers
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