diff options
Diffstat (limited to 'deps/v8/src/string-builder.h')
-rw-r--r-- | deps/v8/src/string-builder.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/deps/v8/src/string-builder.h b/deps/v8/src/string-builder.h index 554277dab1..98bd82b97a 100644 --- a/deps/v8/src/string-builder.h +++ b/deps/v8/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: @@ -429,7 +431,7 @@ void IncrementalStringBuilder::Append(SrcChar c) { } if (current_index_ == part_length_) Extend(); } -} -} // namespace v8::internal +} // namespace internal +} // namespace v8 #endif // V8_STRING_BUILDER_H_ |