void MetadataNode::InjectPrototype(Handle<Object>& target, Handle<Object>& implementationObject)
{
	auto isolate = Isolate::GetCurrent();

	implementationObject->SetAccessor(ConvertToV8String("super"), SuperAccessorGetterCallback, nullptr, implementationObject);
	implementationObject->SetPrototype(target->GetPrototype());
	target->SetPrototype(implementationObject);
}
Пример #2
0
bool
FunctionTemplate::HasInstance(Handle<Value> v)
{
  Handle<Object> object = v->ToObject();
  if (object.IsEmpty())
    return false;
  Handle<Object> proto = object->GetPrototype().As<Object>();
  if (proto.IsEmpty()) {
    return false;
  }
  return InternalObject().Equals(proto);
}