Skip to content

Add a test for an abrupt completion when getting "flags" property in String.prototype.matchAll - #5111

Open
Koreangung15 wants to merge 2 commits into
tc39:mainfrom
Koreangung15:matchAll-flags-getter-throws
Open

Add a test for an abrupt completion when getting "flags" property in String.prototype.matchAll#5111
Koreangung15 wants to merge 2 commits into
tc39:mainfrom
Koreangung15:matchAll-flags-getter-throws

Conversation

@Koreangung15

@Koreangung15 Koreangung15 commented Aug 19, 2026

Copy link
Copy Markdown

This PR adds a test for abrupt completion propagation resulting from the Get operation performed in step 3.b.i of String.prototype.matchAll.

String.prototype.matchAll determines whether regexpOrPattern is a regular expression by performing IsRegExp operation. If IsRegExp returns true, it retrieves the "flags" property of regexpOrPattern.

This test sets the "Symbol.match" property to true, causing IsRegExp to return true, and defines "flags" property as a throwing getter. So, accessing this property causes the Get operation to return an abrupt completion, which is then propagated.

Existing test/built-ins/String/prototype/matchAll/flags-nonglobal-throws.js and test/built-ins/String/prototype/matchAll/flags-undefined-throws.js cover failures after the "flags" property has been successfully retrieved. They do not cover an abrupt completion from retrieving the property itself.

@Koreangung15
Koreangung15 requested a review from a team as a code owner August 19, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant