Tiny cleanup.
authorishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Apr 2014 08:35:04 +0000 (08:35 +0000)
committerishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Apr 2014 08:35:04 +0000 (08:35 +0000)
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

src/api.cc
src/objects.cc
test/cctest/test-strings.cc

index bd62d10..705cae5 100644 (file)
@@ -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);
index 224f71a..8cada3b 100644 (file)
@@ -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());
index 1cfc28d..cf7bb6f 100644 (file)
@@ -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