Commit e493dc9c authored by ishell@chromium.org's avatar ishell@chromium.org

Tiny cleanup.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/247953003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20925 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0b78957d
......@@ -5330,7 +5330,7 @@ MUST_USE_RESULT
inline i::MaybeHandle<i::String> NewString(i::Factory* factory,
String::NewStringType type,
i::Vector<const char> string) {
if (type ==String::kInternalizedString) {
if (type == String::kInternalizedString) {
return factory->InternalizeUtf8String(string);
}
return factory->NewStringFromUtf8(string);
......
......@@ -10416,7 +10416,7 @@ void Oddball::Initialize(Isolate* isolate,
Handle<Object> to_number,
byte kind) {
Handle<String> internalized_to_string =
isolate->factory()->InternalizeUtf8String(CStrVector(to_string));
isolate->factory()->InternalizeUtf8String(to_string);
oddball->set_to_string(*internalized_to_string);
oddball->set_to_number(*to_number);
oddball->set_kind(kind);
......@@ -15600,7 +15600,6 @@ Handle<String> StringTable::LookupString(Isolate* isolate,
}
// TODO(ishell): Maybehandlify callers.
Handle<String> StringTable::LookupKey(Isolate* isolate, HashTableKey* key) {
Handle<StringTable> table = isolate->factory()->string_table();
int entry = table->FindEntry(key);
......@@ -15615,8 +15614,9 @@ Handle<String> StringTable::LookupKey(Isolate* isolate, HashTableKey* key) {
// Create string object.
Handle<Object> string = key->AsHandle(isolate);
// TODO(ishell): Maybehandlify this.
if (string.is_null()) return Handle<String>();
// There must be no attempts to internalize strings that could throw
// InvalidStringLength error.
CHECK(!string.is_null());
// Add the new string and return it along with the string table.
entry = table->FindInsertionEntry(key->Hash());
......
......@@ -1418,7 +1418,5 @@ TEST(InvalidExternalString) {
INVALID_STRING_TEST(NewStringFromAscii, char)
INVALID_STRING_TEST(NewStringFromUtf8, char)
INVALID_STRING_TEST(NewStringFromOneByte, uint8_t)
INVALID_STRING_TEST(InternalizeOneByteString, uint8_t)
INVALID_STRING_TEST(InternalizeUtf8String, char)
#undef INVALID_STRING_TEST
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