[webkit-reviews] review granted: [Bug 205783] RegExp.prototype[Symbol.replace] does not support named capture groups : [Attachment 386803] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 6 15:43:14 PST 2020


Ross Kirsling <ross.kirsling at sony.com> has granted Alexey Shvayka
<shvaikalesh at gmail.com>'s request for review:
Bug 205783: RegExp.prototype[Symbol.replace] does not support named capture
groups
https://bugs.webkit.org/show_bug.cgi?id=205783

Attachment 386803: Patch

https://bugs.webkit.org/attachment.cgi?id=386803&action=review




--- Comment #2 from Ross Kirsling <ross.kirsling at sony.com> ---
Comment on attachment 386803
  --> https://bugs.webkit.org/attachment.cgi?id=386803
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=386803&action=review

r=me with nits

> Source/JavaScriptCore/ChangeLog:10
> +	   (step 14.j of
https://tc39.es/ecma262/#sec-regexp.prototype-@@replace)

Probably better to indicate that it's not just 14.j but 14.j-l.

> Source/JavaScriptCore/builtins/RegExpPrototype.js:360
> +		   namedCaptures = @toObject(namedCaptures,
"RegExp.prototype[Symbol.replace] requires result.group not be null or
undefined");

Hmm, this is meant to be `result.groups`, right?  Though that still seems a bit
problematic since `result` is an internal name. And I guess we've verified that
it's not undefined.

How about this?
"RegExp.prototype.@@replace does not allow matches to have a null 'groups'
property."


More information about the webkit-reviews mailing list