| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 628a3fb3d1541c6e0c366fc7e32b8cb75dc26164..36271ca9b2e16d40285fceabf6020e6f010eefa4 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -5328,9 +5328,10 @@ inline int StringLength(const uint16_t* string) {
|
| }
|
|
|
|
|
| -inline i::Handle<i::String> NewString(i::Factory* factory,
|
| - String::NewStringType type,
|
| - i::Vector<const char> string) {
|
| +MUST_USE_RESULT
|
| +inline i::MaybeHandle<i::String> NewString(i::Factory* factory,
|
| + String::NewStringType type,
|
| + i::Vector<const char> string) {
|
| if (type ==String::kInternalizedString) {
|
| return factory->InternalizeUtf8String(string);
|
| }
|
| @@ -5338,9 +5339,10 @@ inline i::Handle<i::String> NewString(i::Factory* factory,
|
| }
|
|
|
|
|
| -inline i::Handle<i::String> NewString(i::Factory* factory,
|
| - String::NewStringType type,
|
| - i::Vector<const uint8_t> string) {
|
| +MUST_USE_RESULT
|
| +inline i::MaybeHandle<i::String> NewString(i::Factory* factory,
|
| + String::NewStringType type,
|
| + i::Vector<const uint8_t> string) {
|
| if (type == String::kInternalizedString) {
|
| return factory->InternalizeOneByteString(string);
|
| }
|
| @@ -5348,9 +5350,10 @@ inline i::Handle<i::String> NewString(i::Factory* factory,
|
| }
|
|
|
|
|
| -inline i::Handle<i::String> NewString(i::Factory* factory,
|
| - String::NewStringType type,
|
| - i::Vector<const uint16_t> string) {
|
| +MUST_USE_RESULT
|
| +inline i::MaybeHandle<i::String> NewString(i::Factory* factory,
|
| + String::NewStringType type,
|
| + i::Vector<const uint16_t> string) {
|
| if (type == String::kInternalizedString) {
|
| return factory->InternalizeTwoByteString(string);
|
| }
|
| @@ -5373,10 +5376,11 @@ inline Local<String> NewString(Isolate* v8_isolate,
|
| }
|
| ENTER_V8(isolate);
|
| if (length == -1) length = StringLength(data);
|
| - i::Handle<i::String> result = NewString(
|
| - isolate->factory(), type, i::Vector<const Char>(data, length));
|
| // We do not expect this to fail. Change this if it does.
|
| - CHECK(!result.is_null());
|
| + i::Handle<i::String> result = NewString(
|
| + isolate->factory(),
|
| + type,
|
| + i::Vector<const Char>(data, length)).ToHandleChecked();
|
| if (type == String::kUndetectableString) {
|
| result->MarkAsUndetectable();
|
| }
|
|
|