Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 1caaff05f8e0fc61018a6bd245f8c41ceef75d7b..e091c8fb5e3152a1cc39c2b9d89aa0aa2ceb353f 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -911,6 +911,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayBufferIsView) { |
RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayBufferNeuter) { |
HandleScope scope(isolate); |
CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, array_buffer, 0); |
+ if (array_buffer->backing_store() == NULL) { |
+ CHECK(Smi::FromInt(0) == array_buffer->byte_length()); |
+ return isolate->heap()->undefined_value(); |
+ } |
Jarin
2014/03/25 10:59:42
How about keeping just one return statement? That
Dmitry Lomov (no reviews)
2014/03/25 11:04:25
I think that complicates code for the edge case.
Sven Panne
2014/03/25 11:30:35
Actually I like the initial version, too, a "comb-
|
ASSERT(!array_buffer->is_external()); |
void* backing_store = array_buffer->backing_store(); |
size_t byte_length = NumberToSize(isolate, array_buffer->byte_length()); |