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

Unified Diff: src/objects.h

Issue 2791183002: [regexp] Throw on invalid capture group names in replacer string (Closed)
Patch Set: Typo 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 | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index f7b8889de5010c85d815ff8b01e3203af8719c23..c7419798b663c48ad8cd47eb8fffdb272881bae3 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -9267,11 +9267,15 @@ class String: public Name {
virtual Handle<String> GetPrefix() = 0;
virtual Handle<String> GetSuffix() = 0;
+ // A named capture can be invalid (if it is not specified in the pattern),
+ // unmatched (specified but not matched in the current string), and matched.
+ enum CaptureState { INVALID, UNMATCHED, MATCHED };
+
virtual int CaptureCount() = 0;
virtual bool HasNamedCaptures() = 0;
virtual MaybeHandle<String> GetCapture(int i, bool* capture_exists) = 0;
virtual MaybeHandle<String> GetNamedCapture(Handle<String> name,
- bool* capture_exists) = 0;
+ CaptureState* state) = 0;
virtual ~Match() {}
};
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698