summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js
new file mode 100644
index 0000000000..a3c9deba9e
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/next-missing-internal-slots.js
@@ -0,0 +1,23 @@
+// Copyright (C) 2018 Peter Wong. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: pending
+description: Throws TypeError when `this` does not have all internal slots
+info: |
+ %RegExpStringIteratorPrototype%.next ( )
+ 1. Let O be the this value.
+ 2. If Type(O) is not Object, throw a TypeError exception.
+ 3. If O does not have all of the internal slots of a RegExp String Iterator
+ Object Instance (see PropertiesOfRegExpStringIteratorInstances), throw a
+ TypeError.
+features: [Symbol.matchAll]
+---*/
+
+var iterator = /./[Symbol.matchAll]('');
+var object = Object.create(iterator);
+
+assert.throws(TypeError, function() {
+ object.next();
+});
+
+reportCompare(0, 0);