summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.js')
-rw-r--r--js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.js26
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_T1.js b/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.js
new file mode 100644
index 0000000000..55215f44f5
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Array/prototype/splice/S15.4.4.12_A6.1_T1.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 sets `length` on Array
+---*/
+
+var a = [0, 1, 2];
+
+a.splice(1, 2, 4);
+
+if (a.length !== 2) {
+ throw new Test262Error("Expected a.length === 2, actually " + a.length);
+}
+
+if (a[0] !== 0) {
+ throw new Test262Error("Expected a[0] === 0, actually " + a[0]);
+}
+
+if (a[1] !== 4) {
+ throw new Test262Error("Expected a[1] === 4, actually " + a[1]);
+}
+
+reportCompare(0, 0);