summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js')
-rw-r--r--js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js
new file mode 100644
index 0000000000..76d827aa5e
--- /dev/null
+++ b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js
@@ -0,0 +1,21 @@
+// 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-arraybuffer.prototype.bytelength
+description: Returns 0 if the buffer is detached
+info: |
+ get ArrayBuffer.prototype.byteLength
+ ...
+ If IsDetachedBuffer(buffer) is true, return 0.
+ ...
+includes: [detachArrayBuffer.js]
+features: [align-detached-buffer-semantics-with-web-reality]
+---*/
+
+var ab = new ArrayBuffer(1);
+
+$DETACHBUFFER(ab);
+
+assert.sameValue(ab.byteLength, 0, 'The value of ab.byteLength is 0');
+
+reportCompare(0, 0);