Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
dskloet
10y ago
0 comments
Save
Share
p2.constructor = Person;
Without that, the object also doesn't have the right prototype.
0 comments
3 comments · 2 top-level
top
newest
oldest
gurgus
9y ago
· 1 in thread
All fixed up now. Thanks for the feedback :) I ended up setting __proto__ directly so that an instanceof test passes.
dskloet
OP
9y ago
Looks like that didn't work either and you ended up with Object.create which is a fairly new function. I think assigning Person.prototype (instead of Person) to p2.__proto__ would have worked. Or is that already what you had before?
gurgus
10y ago
Thanks! Will update my post and attribute you with that!
j
/
k
navigate · click thread line to collapse