Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: src/api.cc

Issue 848173002: Remove support for signatures with arguments (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698