Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index c04393d8be1ec53c7b6fb0376447c4379e703ec4..6a7c40a06c96cc3246fde4c52f4cf94657e836da 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6038,6 +6038,11 @@ bool v8::ArrayBuffer::IsExternal() const { |
} |
+bool v8::ArrayBuffer::IsNeuterable() const { |
+ return Utils::OpenHandle(this)->is_neuterable(); |
+} |
+ |
+ |
v8::ArrayBuffer::Contents v8::ArrayBuffer::Externalize() { |
i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(this); |
Utils::ApiCheck(!obj->is_external(), |
@@ -6058,6 +6063,8 @@ void v8::ArrayBuffer::Neuter() { |
Utils::ApiCheck(obj->is_external(), |
"v8::ArrayBuffer::Neuter", |
"Only externalized ArrayBuffers can be neutered"); |
+ Utils::ApiCheck(obj->is_neuterable(), "v8::ArrayBuffer::Neuter", |
+ "Only neuterable ArrayBuffers can be neutered"); |
LOG_API(obj->GetIsolate(), "v8::ArrayBuffer::Neuter()"); |
ENTER_V8(isolate); |
i::Runtime::NeuterArrayBuffer(obj); |