ext/v8/v8_string.cpp in therubyracer-0.9.0beta7 vs ext/v8/v8_string.cpp in therubyracer-0.9.0

- old
+ new

@@ -22,18 +22,20 @@ VALUE str = rb_funcall(data, rb_intern("to_s"), 0); return rr_v8_handle_new(string_class, String::NewSymbol(RSTRING_PTR(str), RSTRING_LEN(str))); } VALUE Utf8Value(VALUE self) { HandleScope handles; - return rb_str_new2(*String::Utf8Value(unwrap(self))); + Handle<String> str = unwrap(self); + return rb_str_new(*String::Utf8Value(str), str->Utf8Length()); } VALUE Utf16Value(VALUE self) { //How are UTF16 strings represented in ruby 1.8, 1.9 return Qnil; } VALUE AsciiValue(VALUE self) { HandleScope handles; - return rb_str_new2(*String::AsciiValue(unwrap(self))); + Handle<String> str = unwrap(self); + return rb_str_new(*String::AsciiValue(str), str->Length()); } } VALUE rr_reflect_v8_string(Handle<Value> value) { return rr_v8_handle_new(StringClass, Handle<String>::Cast(value));