diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/this-is-sharedarraybuffer.js')
-rw-r--r-- | js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/this-is-sharedarraybuffer.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/this-is-sharedarraybuffer.js b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/this-is-sharedarraybuffer.js new file mode 100644 index 0000000000..4fb55facb0 --- /dev/null +++ b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/this-is-sharedarraybuffer.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-arraybuffer.prototype.slice +description: > + Throws a TypeError if `this` is a SharedArrayBuffer +features: [SharedArrayBuffer] +---*/ + +assert.throws(TypeError, function() { + var sab = new SharedArrayBuffer(0); + ArrayBuffer.prototype.slice.call(sab); +}, "`this` value cannot be a SharedArrayBuffer"); + +reportCompare(0, 0); |