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

16 lines
531 B
C++
Raw Normal View History

#include "rr.h"
namespace rr {
void Signature::Init() {
ClassBuilder("Signature").
defineMethod("New", &New).
store(&Class);
}
VALUE Signature::New(int length, VALUE args[], VALUE self) {
VALUE receiver; VALUE argc; VALUE argv;
rb_scan_args(length, args, "03", &receiver, &argc, &argv);
2012-05-23 00:06:21 -04:00
std::vector< v8::Handle<v8::FunctionTemplate> > parameters(NUM2INT(argc));
return Signature(v8::Signature::New(FunctionTemplate(receiver), NUM2INT(argc), FunctionTemplate::array(argv, parameters)));
}
}