summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js')
-rw-r--r--js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js
new file mode 100644
index 0000000000..b70afc1f65
--- /dev/null
+++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/custom-regexpexec-get-throws.js
@@ -0,0 +1,30 @@
+// Copyright (C) 2018 Peter Wong. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: pending
+description: Re-throws errors thrown while accessing RegExp's exec property
+info: |
+ %RegExpStringIteratorPrototype%.next ( )
+ [...]
+ 9. Let match be ? RegExpExec(R, S).
+
+ Runtime Semantics: RegExpExec ( R, S )
+ 1. Assert: Type(R) is Object.
+ 2. Assert: Type(S) is String.
+ 3. Let exec be ? Get(R, "exec").
+features: [Symbol.matchAll]
+---*/
+
+var iter = /./[Symbol.matchAll]('');
+
+Object.defineProperty(RegExp.prototype, 'exec', {
+ get() {
+ throw new Test262Error();
+ }
+});
+
+assert.throws(Test262Error, function() {
+ iter.next();
+});
+
+reportCompare(0, 0);