Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 708135e71724b1f44735ca35a50769a97854413b..d67fc9eb216c65db935c348d08ce7a098d7a5fac 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -17957,8 +17957,20 @@ void StringTable::EnsureCapacityForDeserialization(Isolate* isolate, |
Handle<String> StringTable::LookupString(Isolate* isolate, |
Handle<String> string) { |
+ if (string->IsConsString() && string->IsFlat()) { |
+ string = String::Flatten(string); |
+ if (string->IsInternalizedString()) return string; |
+ } |
+ |
InternalizedStringKey key(string); |
- return LookupKey(isolate, &key); |
+ Handle<String> result = LookupKey(isolate, &key); |
+ |
+ if (string->IsConsString()) { |
+ Handle<ConsString> cons = Handle<ConsString>::cast(string); |
+ cons->set_first(*result); |
+ cons->set_second(isolate->heap()->empty_string()); |
+ } |
+ return result; |
} |