Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 889d2045f162bfa15a49ac9b55c60a436f5ff492..3335c2f3408e0cf5fc88061241ffb1a82d94378f 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -15694,4 +15694,19 @@ void JSDate::SetLocalFields(int64_t local_time_ms, DateCache* date_cache) { |
set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
} |
+ |
+void JSArrayBuffer::Neuter() { |
+ ASSERT(is_external()); |
+ set_backing_store(NULL); |
+ set_byte_length(Smi::FromInt(0)); |
+} |
+ |
+ |
+void JSTypedArray::Neuter() { |
+ set_byte_offset(Smi::FromInt(0)); |
+ set_byte_length(Smi::FromInt(0)); |
+ set_length(Smi::FromInt(0)); |
+ set_elements(GetHeap()->EmptyExternalArrayForMap(map())); |
+} |
+ |
} } // namespace v8::internal |