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-05-22 23:06:21 -05:00

16 lines
No EOL
531 B
C++

#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);
std::vector< v8::Handle<v8::FunctionTemplate> > parameters(NUM2INT(argc));
return Signature(v8::Signature::New(FunctionTemplate(receiver), NUM2INT(argc), FunctionTemplate::array(argv, parameters)));
}
}