2012-05-02 19:15:11 -04:00
|
|
|
#include "rr.h"
|
|
|
|
|
|
|
|
namespace rr {
|
|
|
|
|
2012-05-03 18:21:25 -04:00
|
|
|
void Script::Init() {
|
|
|
|
ClassBuilder("Script").
|
|
|
|
defineSingletonMethod("New", &New).
|
2012-05-15 17:24:58 -04:00
|
|
|
defineMethod("Run", &Run).
|
|
|
|
store(&Class);
|
2012-05-03 18:21:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
VALUE Script::New(VALUE klass, VALUE source, VALUE filename) {
|
2012-05-15 13:23:06 -04:00
|
|
|
return Script(v8::Script::New(String(source), Value(filename)));
|
2012-05-02 19:15:11 -04:00
|
|
|
}
|
|
|
|
|
2012-05-03 18:21:25 -04:00
|
|
|
VALUE Script::Run(VALUE self) {
|
2012-05-15 17:24:58 -04:00
|
|
|
return Value(Script(self)->Run());
|
2012-05-02 19:15:11 -04:00
|
|
|
}
|
|
|
|
|
2012-05-03 18:21:25 -04:00
|
|
|
} //namespace rr
|