diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js b/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js new file mode 100644 index 0000000000..9a6823e058 --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T3.js @@ -0,0 +1,26 @@ +// 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 = { + get length() { + return 0; + }, + splice: Array.prototype.splice +}; + +try { + a.splice(1, 2, 4); + throw new Test262Error("Expected a TypeError"); +} catch (e) { + if (!(e instanceof TypeError)) { + throw e; + } +} + +reportCompare(0, 0); |