Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 03d79a54b23d3ad69fb5ed6e73bb325d343cbe2a..3f6e1090a05633df5c666dededd19ab0c969157b 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -856,11 +856,8 @@ Local<Signature> Signature::New(Isolate* isolate, |
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
LOG_API(i_isolate, "Signature::New"); |
ENTER_V8(i_isolate); |
- i::Handle<i::Struct> struct_obj = |
- i_isolate->factory()->NewStruct(i::SIGNATURE_INFO_TYPE); |
i::Handle<i::SignatureInfo> obj = |
- i::Handle<i::SignatureInfo>::cast(struct_obj); |
- if (!receiver.IsEmpty()) obj->set_receiver(*Utils::OpenHandle(*receiver)); |
+ Utils::OpenHandle(*Signature::New(isolate, receiver)); |
if (argc > 0) { |
i::Handle<i::FixedArray> args = i_isolate->factory()->NewFixedArray(argc); |
for (int i = 0; i < argc; i++) { |
@@ -873,6 +870,22 @@ Local<Signature> Signature::New(Isolate* isolate, |
} |
+Local<Signature> Signature::New(Isolate* isolate, |
+ Handle<FunctionTemplate> receiver) { |
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
+ LOG_API(i_isolate, "Signature::New"); |
+ ENTER_V8(i_isolate); |
+ i::Handle<i::Struct> struct_obj = |
+ i_isolate->factory()->NewStruct(i::SIGNATURE_INFO_TYPE); |
+ // TODO(jochen): Replace SignatureInfo with FunctionTemplateInfo once the |
+ // deprecated API is deleted. |
+ i::Handle<i::SignatureInfo> obj = |
+ i::Handle<i::SignatureInfo>::cast(struct_obj); |
+ if (!receiver.IsEmpty()) obj->set_receiver(*Utils::OpenHandle(*receiver)); |
+ return Utils::ToLocal(obj); |
+} |
+ |
+ |
Local<AccessorSignature> AccessorSignature::New( |
Isolate* isolate, |
Handle<FunctionTemplate> receiver) { |