Bug 176434
Summary: | FIXME Bug: Add code if needed to throw Syntax errors for bad named capture references in String.prototype.replace | ||
---|---|---|---|
Product: | WebKit | Reporter: | Michael Saboff <msaboff> |
Component: | JavaScriptCore | Assignee: | Michael Saboff <msaboff> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ashvayka, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Other | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=205785 |
Michael Saboff
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/34270676>
Alexey Shvayka
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.