summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/non-own-slots.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/non-own-slots.js')
-rw-r--r--js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/non-own-slots.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/non-own-slots.js b/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/non-own-slots.js
new file mode 100644
index 0000000000..fdac743d42
--- /dev/null
+++ b/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/non-own-slots.js
@@ -0,0 +1,20 @@
+// Copyright (C) 2013 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: >
+ If the `this` value does not have all of the internal slots of an Array
+ Iterator Instance (22.1.5.3), throw a TypeError exception.
+esid: sec-%arrayiteratorprototype%.next
+features: [Symbol.iterator]
+---*/
+
+var array = [0];
+var iterator = array[Symbol.iterator]();
+var object = Object.create(iterator);
+
+assert.throws(TypeError, function() {
+ object.next();
+});
+
+reportCompare(0, 0);