1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/ext/v8/signature.cc
2012-06-12 07:06:25 -05:00

18 lines
No EOL
498 B
C++

#include "rr.h"
namespace rr {
void Signature::Init() {
ClassBuilder("Signature").
defineMethod("New", &New).
store(&Class);
}
VALUE Signature::New(int argc, VALUE args[], VALUE self) {
VALUE receiver; VALUE argv;
rb_scan_args(argc, args, "02", &receiver, &argv);
FunctionTemplate recv(receiver);
int length = RARRAY_LENINT(argv);
FunctionTemplate::array<FunctionTemplate> types(argv);
return Signature(v8::Signature::New(recv, length, types));
}
}