2009-12-18 02:48:06 -05:00
|
|
|
#include "v8_msg.h"
|
|
|
|
#include "v8_ref.h"
|
|
|
|
|
|
|
|
using namespace v8;
|
|
|
|
|
2010-05-18 06:27:23 -04:00
|
|
|
namespace {
|
|
|
|
VALUE MessageClass;
|
|
|
|
|
|
|
|
Local<Message> unwrap(VALUE self) {
|
|
|
|
return V8_Ref_Get<Message>(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE Get(VALUE self) {
|
|
|
|
Local<Message> message(unwrap(self));
|
|
|
|
return rr_v82rb(message->Get());
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE GetSourceLine(VALUE self) {
|
|
|
|
return rr_v82rb(unwrap(self)->GetSourceLine());
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE GetScriptResourceName(VALUE self) {
|
|
|
|
return rr_v82rb(unwrap(self)->GetScriptResourceName());
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE GetLineNumber(VALUE self) {
|
|
|
|
return rr_v82rb(unwrap(self)->GetLineNumber());
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE GetStartPosition(VALUE self) {
|
|
|
|
return rr_v82rb(unwrap(self)->GetStartPosition());
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE GetEndPosition(VALUE self) {
|
|
|
|
return rr_v82rb(unwrap(self)->GetEndPosition());
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE GetStartColumn(VALUE self) {
|
|
|
|
return rr_v82rb(unwrap(self)->GetStartColumn());
|
|
|
|
}
|
|
|
|
|
|
|
|
VALUE GetEndColumn(VALUE self) {
|
|
|
|
return rr_v82rb(unwrap(self)->GetEndColumn());
|
|
|
|
}
|
2010-02-08 11:53:20 -05:00
|
|
|
}
|
|
|
|
|
2010-05-18 06:27:23 -04:00
|
|
|
void rr_init_msg() {
|
|
|
|
MessageClass = rr_define_class("Message");
|
|
|
|
rr_define_method(MessageClass, "Get", Get, 0);
|
|
|
|
rr_define_method(MessageClass, "GetSourceLine", GetSourceLine, 0);
|
|
|
|
rr_define_method(MessageClass, "GetScriptResourceName", GetScriptResourceName, 0);
|
|
|
|
rr_define_method(MessageClass, "GetLineNumber", GetLineNumber, 0);
|
|
|
|
rr_define_method(MessageClass, "GetStartPosition", GetStartPosition, 0);
|
|
|
|
rr_define_method(MessageClass, "GetEndPosition", GetEndPosition, 0);
|
|
|
|
rr_define_method(MessageClass, "GetStartColumn", GetStartColumn, 0);
|
|
|
|
rr_define_method(MessageClass, "GetEndColumn", GetEndColumn, 0);
|
2010-02-08 11:53:20 -05:00
|
|
|
}
|
|
|
|
|
2010-05-18 06:27:23 -04:00
|
|
|
VALUE rr_reflect_v8_message(Handle<Message> value) {
|
|
|
|
return V8_Ref_Create(MessageClass, value);
|
2010-02-08 11:53:20 -05:00
|
|
|
}
|
|
|
|
|