Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Unified Diff: src/runtime/runtime-regexp.cc

Issue 2776263003: [regexp] Handle unmatched groups in callable replacers (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/regexp-named-captures.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-regexp.cc
diff --git a/src/runtime/runtime-regexp.cc b/src/runtime/runtime-regexp.cc
index e5d6e4c71ed8cfac85fc4d823d1cb45c89bf1a80..0bc874aa86205cf2071cf5c585706126c8ea80ac 100644
--- a/src/runtime/runtime-regexp.cc
+++ b/src/runtime/runtime-regexp.cc
@@ -1125,7 +1125,7 @@ Handle<JSObject> ConstructNamedCaptureGroupsObject(
DCHECK(1 <= capture_ix && capture_ix <= capture_count);
Handle<Object> capture_value(f_get_capture(capture_ix), isolate);
- DCHECK(capture_value->IsString());
+ DCHECK(capture_value->IsUndefined(isolate) || capture_value->IsString());
JSObject::AddProperty(groups, capture_name, capture_value, NONE);
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/regexp-named-captures.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698