Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index f3f5b16914ea2c5f4a146575f8dc3f06a587b58b..f152175e0b5ed0c15a2b82eed0fb3311c484be16 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -4790,6 +4790,7 @@ Local<String> v8::String::NewExternal( |
EnsureInitializedForIsolate(isolate, "v8::String::NewExternal()"); |
LOG_API(isolate, "String::NewExternal"); |
ENTER_V8(isolate); |
+ CHECK(resource && resource->data()); |
i::Handle<i::String> result = NewExternalStringHandle(isolate, resource); |
isolate->heap()->external_string_table()->AddString(*result); |
return Utils::ToLocal(result); |
@@ -4810,6 +4811,7 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) { |
if (isolate->heap()->IsInGCPostProcessing()) { |
return false; |
} |
+ CHECK(resource && resource->data()); |
bool result = obj->MakeExternal(resource); |
if (result && !obj->IsSymbol()) { |
isolate->heap()->external_string_table()->AddString(*obj); |
@@ -4824,6 +4826,7 @@ Local<String> v8::String::NewExternal( |
EnsureInitializedForIsolate(isolate, "v8::String::NewExternal()"); |
LOG_API(isolate, "String::NewExternal"); |
ENTER_V8(isolate); |
+ CHECK(resource && resource->data()); |
i::Handle<i::String> result = NewExternalAsciiStringHandle(isolate, resource); |
isolate->heap()->external_string_table()->AddString(*result); |
return Utils::ToLocal(result); |
@@ -4845,6 +4848,7 @@ bool v8::String::MakeExternal( |
if (isolate->heap()->IsInGCPostProcessing()) { |
return false; |
} |
+ CHECK(resource && resource->data()); |
bool result = obj->MakeExternal(resource); |
if (result && !obj->IsSymbol()) { |
isolate->heap()->external_string_table()->AddString(*obj); |