summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/DataView/prototype/buffer/detached-buffer.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/DataView/prototype/buffer/detached-buffer.js')
-rw-r--r--js/src/tests/test262/built-ins/DataView/prototype/buffer/detached-buffer.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/DataView/prototype/buffer/detached-buffer.js b/js/src/tests/test262/built-ins/DataView/prototype/buffer/detached-buffer.js
new file mode 100644
index 0000000000..7b7466cc96
--- /dev/null
+++ b/js/src/tests/test262/built-ins/DataView/prototype/buffer/detached-buffer.js
@@ -0,0 +1,22 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-get-dataview.prototype.buffer
+description: The getter method does not throw with a detached buffer
+info: |
+ 24.2.4.1 get DataView.prototype.buffer
+
+ ...
+ 5. Let buffer be the value of O's [[ViewedArrayBuffer]] internal slot.
+ 6. Return buffer.
+includes: [detachArrayBuffer.js]
+---*/
+
+var buffer = new ArrayBuffer(8);
+var sample = new DataView(buffer, 0);
+
+$DETACHBUFFER(sample.buffer);
+assert.sameValue(sample.buffer, buffer);
+
+reportCompare(0, 0);