Index: src/string-builder.h |
diff --git a/src/string-builder.h b/src/string-builder.h |
index 76b6f5bf1359623b553444e7577c3186979d7690..98bd82b97a011712e14c8365e1c007231378c211 100644 |
--- a/src/string-builder.h |
+++ b/src/string-builder.h |
@@ -346,10 +346,12 @@ class IncrementalStringBuilder { |
DCHECK(string->length() >= required_length); |
} |
- ~NoExtendString() { |
+ Handle<String> Finalize() { |
Handle<SeqString> string = Handle<SeqString>::cast(string_); |
int length = NoExtend<DestChar>::written(); |
- *string_.location() = *SeqString::Truncate(string, length); |
+ Handle<String> result = SeqString::Truncate(string, length); |
+ string_ = Handle<String>(); |
+ return result; |
} |
private: |