Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: src/json-stringifier.h

Issue 223573002: Return MaybeHandle from NewRaw???String. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/json-parser.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index 17c6b6f11141c52a589515f5d706371112411a8d..a083d48a09783348e2f006c212e0edda2ea6a8da 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -265,8 +265,7 @@ BasicJsonStringifier::BasicJsonStringifier(Isolate* isolate)
accumulator_store_ = Handle<JSValue>::cast(
factory_->ToObject(factory_->empty_string()));
part_length_ = kInitialPartLength;
- current_part_ = factory_->NewRawOneByteString(part_length_);
- ASSERT(!current_part_.is_null());
+ current_part_ = factory_->NewRawOneByteString(part_length_).ToHandleChecked();
tojson_string_ = factory_->toJSON_string();
stack_ = factory_->NewJSArray(8);
}
@@ -308,18 +307,16 @@ MaybeObject* BasicJsonStringifier::StringifyString(Isolate* isolate,
FlattenString(object);
ASSERT(object->IsFlat());
if (object->IsOneByteRepresentationUnderneath()) {
- Handle<String> result =
- isolate->factory()->NewRawOneByteString(worst_case_length);
- ASSERT(!result.is_null());
+ Handle<String> result = isolate->factory()->NewRawOneByteString(
+ worst_case_length).ToHandleChecked();
DisallowHeapAllocation no_gc;
return StringifyString_<SeqOneByteString>(
isolate,
object->GetFlatContent().ToOneByteVector(),
result);
} else {
- Handle<String> result =
- isolate->factory()->NewRawTwoByteString(worst_case_length);
- ASSERT(!result.is_null());
+ Handle<String> result = isolate->factory()->NewRawTwoByteString(
+ worst_case_length).ToHandleChecked();
DisallowHeapAllocation no_gc;
return StringifyString_<SeqTwoByteString>(
isolate,
@@ -742,9 +739,11 @@ void BasicJsonStringifier::Extend() {
part_length_ *= kPartLengthGrowthFactor;
}
if (is_ascii_) {
- current_part_ = factory_->NewRawOneByteString(part_length_);
+ current_part_ =
+ factory_->NewRawOneByteString(part_length_).ToHandleChecked();
} else {
- current_part_ = factory_->NewRawTwoByteString(part_length_);
+ current_part_ =
+ factory_->NewRawTwoByteString(part_length_).ToHandleChecked();
}
ASSERT(!current_part_.is_null());
current_index_ = 0;
@@ -754,7 +753,8 @@ void BasicJsonStringifier::Extend() {
void BasicJsonStringifier::ChangeEncoding() {
ShrinkCurrentPart();
Accumulate();
- current_part_ = factory_->NewRawTwoByteString(part_length_);
+ current_part_ =
+ factory_->NewRawTwoByteString(part_length_).ToHandleChecked();
ASSERT(!current_part_.is_null());
current_index_ = 0;
is_ascii_ = false;
« no previous file with comments | « src/json-parser.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698