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

don't get carried away with coercion magic.

This commit is contained in:
Charles Lowell 2012-05-03 15:48:49 -07:00
parent 889918adae
commit 1ff80bd128
2 changed files with 4 additions and 7 deletions

View file

@ -125,10 +125,11 @@ public:
static VALUE New(VALUE self, VALUE value);
static VALUE Utf8Value(VALUE self);
inline String(VALUE value) : Ref<v8::String>(value) {}
virtual operator v8::Handle<v8::Value>();
static VALUE ToRuby(v8::Handle<v8::String> value);
inline String(VALUE value) : Ref<v8::String>(value) {}
private:
static VALUE Class;
};

View file

@ -19,15 +19,11 @@ VALUE String::New(VALUE StringClass, VALUE string) {
VALUE String::Utf8Value(VALUE self) {
v8::HandleScope h;
String str(self);
return rb_str_new(*v8::String::Utf8Value(str), str->Utf8Length());
return rb_str_new(*v8::String::Utf8Value(str.GetHandle()), str->Utf8Length());
}
VALUE String::ToRuby(v8::Handle<v8::String> string) {
return String::create(string, String::Class);
}
String::operator v8::Handle<v8::Value>() {
return this->GetHandle();
}
} //namespace rr