Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / String / prototype / matchAll / regexp-get-matchAll-throws.js
blobebab7328b5fe151dcdc109e0df262342d010e7da
1 // Copyright (C) 2018 Peter Wong. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: pending
5 description: Re-throws errors when calling @@matchAll
6 info: |
7   String.prototype.matchAll ( regexp )
8     [...]
9     2. If regexp is neither undefined nor null, then
10       a. Let matcher be ? GetMethod(regexp, @@matchAll).
11       b. If matcher is not undefined, then
12         i. Return ? Call(matcher, regexp, « O »).
13 features: [Symbol.matchAll, String.prototype.matchAll]
14 ---*/
16 var regexp = /./g;
17 Object.defineProperty(regexp, Symbol.matchAll, {
18   get() {
19     throw new Test262Error();
20   }
21 });
23 assert.throws(Test262Error, function() {
24   ''.matchAll(regexp);
25 });
27 reportCompare(0, 0);