diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/this-is-arraybuffer.js')
-rw-r--r-- | js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/this-is-arraybuffer.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/this-is-arraybuffer.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/this-is-arraybuffer.js new file mode 100644 index 0000000000..ebe64e1ba9 --- /dev/null +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/this-is-arraybuffer.js @@ -0,0 +1,17 @@ +// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// Copyright (C) 2017 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-sharedarraybuffer.prototype.slice +description: > + Throws a TypeError if `this` is an ArrayBuffer +features: [ArrayBuffer, SharedArrayBuffer] +---*/ + +assert.throws(TypeError, function() { + var ab = new ArrayBuffer(0); + SharedArrayBuffer.prototype.slice.call(ab); +}, "`this` value cannot be an ArrayBuffer"); + +reportCompare(0, 0); |