1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/ext/v8/external.cc
2015-07-15 21:14:21 -05:00

26 lines
530 B
C++

#include "rr.h"
#include "external.h"
namespace rr {
void External::Init() {
ClassBuilder("External").
defineSingletonMethod("New", &New).
defineMethod("Value", &Value).
store(&Class);
}
VALUE External::New(VALUE self, VALUE r_isolate, VALUE object) {
Isolate isolate(r_isolate);
Locker lock(isolate);
return External(isolate, wrap(isolate, object));
}
VALUE External::Value(VALUE self) {
External external(self);
Locker lock(external);
return unwrap(external);
}
}