Commit ca37dab9 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Added handling of empty handles to String::AsciiValue and String::Value.

Review URL: http://codereview.chromium.org/7832

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@546 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ba6502bd
......@@ -2689,6 +2689,11 @@ String::Utf8Value::~Utf8Value() {
String::AsciiValue::AsciiValue(v8::Handle<v8::Value> obj) {
EnsureInitialized("v8::String::AsciiValue::AsciiValue()");
if (obj.IsEmpty()) {
str_ = NULL;
length_ = 0;
return;
}
HandleScope scope;
TryCatch try_catch;
Handle<String> str = obj->ToString();
......@@ -2710,6 +2715,11 @@ String::AsciiValue::~AsciiValue() {
String::Value::Value(v8::Handle<v8::Value> obj) {
EnsureInitialized("v8::String::Value::Value()");
if (obj.IsEmpty()) {
str_ = NULL;
length_ = 0;
return;
}
HandleScope scope;
TryCatch try_catch;
Handle<String> str = obj->ToString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment