Bug 176434 - FIXME Bug: Add code if needed to throw Syntax errors for bad named capture references in String.prototype.replace
Summary: FIXME Bug: Add code if needed to throw Syntax errors for bad named capture re...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-05 18:07 PDT by Michael Saboff
Modified: 2020-01-06 11:35 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2017-09-05 18:07:26 PDT
The current proposed named capture groups spec text specifies that we should throw a Syntax Error when processing the replacement string to String.prototype.replace() if there are malformed named capture groups references.  This would be the first type of malformed replacement string text that would cause a throw.  It seems out of place with the rest of the rules for various $<token> replacements.  We have file an issue against the current spec text at https://github.com/tc39/proposal-regexp-named-groups/issues/29.  If we don't prevail, then we'll need to add the throw(SyntaxError, ...) code.
Comment 1 Radar WebKit Bug Importer 2017-09-05 18:08:55 PDT
<rdar://problem/34270676>
Comment 2 Alexey Shvayka 2020-01-06 11:35:39 PST
RegExp named capture groups proposal was changed in https://github.com/tc39/proposal-regexp-named-groups/commit/92ceba518c2ab0d2811c2efa8248ed1b3f8b5506: SyntaxErrors (nor any other errors) are no longer thrown.

FIXME comments are removed in https://bugs.webkit.org/show_bug.cgi?id=205785.