mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
19 lines
No EOL
393 B
C++
19 lines
No EOL
393 B
C++
#include "rr.h"
|
|
|
|
namespace rr {
|
|
|
|
void Script::Init() {
|
|
ClassBuilder("Script").
|
|
defineSingletonMethod("New", &New).
|
|
defineMethod("Run", &Run);
|
|
}
|
|
|
|
VALUE Script::New(VALUE klass, VALUE source, VALUE filename) {
|
|
return Script::create(v8::Script::New(String(source), Value(filename)), klass);
|
|
}
|
|
|
|
VALUE Script::Run(VALUE self) {
|
|
return Convert(Script(self)->Run());
|
|
}
|
|
|
|
} //namespace rr
|