diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js b/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js new file mode 100644 index 0000000000..a865a7bc78 --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T2.js @@ -0,0 +1,20 @@ +// Copyright 2014 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Array.prototype.splice sets `length` on `this` +esid: sec-array.prototype.splice +description: Array.prototype.splice throws if `length` is read-only +---*/ + +var a = [0, 1, 2]; + +Object.defineProperty(a, 'length', { + writable: false +}); + +assert.throws(TypeError, function() { + a.splice(1, 2, 4); +}); + +reportCompare(0, 0); |