1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

move message init to v8_msg.ccp

This commit is contained in:
Charles Lowell 2010-05-10 07:59:48 -05:00
parent 5194b11a5b
commit c9f299957d
3 changed files with 16 additions and 13 deletions

View file

@ -37,17 +37,6 @@ extern "C" {
rr_init_template();
rr_init_obj();
rr_init_func();
V8_C_Message = rb_define_class_under(rb_mNative, "Message", rb_cObject);
rb_define_method(V8_C_Message, "Get", (VALUE(*)(...))v8_Message_Get, 0);
rb_define_method(V8_C_Message, "GetSourceLine", (VALUE(*)(...))v8_Message_GetSourceLine, 0);
rb_define_method(V8_C_Message, "GetScriptResourceName", (VALUE(*)(...))v8_Message_GetScriptResourceName, 0);
rb_define_method(V8_C_Message, "GetLineNumber", (VALUE(*)(...))v8_Message_GetLineNumber, 0);
rb_define_method(V8_C_Message, "GetStartPosition", (VALUE(*)(...))v8_Message_GetStartPosition, 0);
rb_define_method(V8_C_Message, "GetEndPosition", (VALUE(*)(...)) v8_Message_GetEndPosition, 0);
rb_define_method(V8_C_Message, "GetStartColumn", (VALUE(*)(...)) v8_Message_GetStartColumn, 0);
rb_define_method(V8_C_Message, "GetEndColumn", (VALUE(*)(...)) v8_Message_GetEndColumn, 0);
rr_init_msg();
}
}

View file

@ -6,6 +6,18 @@ using namespace v8;
VALUE V8_C_Message;
void rr_init_msg() {
V8_C_Message = rr_define_class("Message");
rb_define_method(V8_C_Message, "Get", (VALUE(*)(...))v8_Message_Get, 0);
rb_define_method(V8_C_Message, "GetSourceLine", (VALUE(*)(...))v8_Message_GetSourceLine, 0);
rb_define_method(V8_C_Message, "GetScriptResourceName", (VALUE(*)(...))v8_Message_GetScriptResourceName, 0);
rb_define_method(V8_C_Message, "GetLineNumber", (VALUE(*)(...))v8_Message_GetLineNumber, 0);
rb_define_method(V8_C_Message, "GetStartPosition", (VALUE(*)(...))v8_Message_GetStartPosition, 0);
rb_define_method(V8_C_Message, "GetEndPosition", (VALUE(*)(...)) v8_Message_GetEndPosition, 0);
rb_define_method(V8_C_Message, "GetStartColumn", (VALUE(*)(...)) v8_Message_GetStartColumn, 0);
rb_define_method(V8_C_Message, "GetEndColumn", (VALUE(*)(...)) v8_Message_GetEndColumn, 0);
}
VALUE V8_Wrap_Message(Handle<v8::Message> msg) {
return V8_Ref_Create(V8_C_Message, msg);
}

View file

@ -2,9 +2,11 @@
#define _RUBY_V8_MESSAGE_
#include "v8.h"
#include "ruby.h"
#include "rr.h"
extern VALUE V8_C_Message;
void rr_init_msg();
VALUE V8_Wrap_Message(v8::Handle<v8::Message> msg);
VALUE v8_Message_Get(VALUE self);
VALUE v8_Message_GetSourceLine(VALUE self);