Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / String / prototype / matchAll / regexp-prototype-matchAll-throws.js
blobfebeeb440c653366493f9a7e66c53c8c9a0a88a7
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]
14 ---*/
16 RegExp.prototype[Symbol.matchAll] = function() {
17   throw new Test262Error();
20 assert.throws(Test262Error, function() {
21   ''.matchAll(/./g);
22 });
24 reportCompare(0, 0);