blob: 246d158f359460b2f62daaf0f1878ea24abedcb5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// 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 from coercing first match to a string
info: |
%RegExpStringIteratorPrototype%.next ( )
[...]
9. Let match be ? RegExpExec(R, S).
10. If match is null, then
[...]
11. Else,
a. If global is true,
i. Let matchStr be ? ToString(? Get(match, "0")).
features: [Symbol.matchAll]
---*/
var iter = /./g[Symbol.matchAll]('');
RegExp.prototype.exec = function() {
return [{
toString: function() {
throw new Test262Error();
}
}];
};
assert.throws(Test262Error, function() {
iter.next();
});
reportCompare(0, 0);
|