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