diff --git a/src/util.cc b/src/util.cc index a0bd077a93aaf9..f382b3d565a8cf 100644 --- a/src/util.cc +++ b/src/util.cc @@ -8,12 +8,12 @@ Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle value) if (value.IsEmpty()) return; - v8::Local val_ = value->ToString(isolate); - if (val_.IsEmpty()) + v8::Local string = value->ToString(isolate); + if (string.IsEmpty()) return; // Allocate enough space to include the null terminator - size_t len = StringBytes::StorageSize(val_, UTF8) + 1; + size_t len = StringBytes::StorageSize(string, UTF8) + 1; if (len > sizeof(str_st_)) { str_ = static_cast(malloc(len)); CHECK_NE(str_, nullptr); @@ -21,7 +21,7 @@ Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle value) const int flags = v8::String::NO_NULL_TERMINATION | v8::String::REPLACE_INVALID_UTF8; - length_ = val_->WriteUtf8(str_, len, 0, flags); + length_ = string->WriteUtf8(str_, len, 0, flags); str_[length_] = '\0'; }