Commit 2a6f7e20 authored by Iain Ireland's avatar Iain Ireland Committed by Commit Bot

[regexp] Undo removal of ParseRegExpSyntax

RegExpParser::ParseRegExpSyntax was added to allow the SpiderMonkey
embedding of irregexp to report early errors. It was removed in
https://chromium-review.googlesource.com/c/v8/v8/+/2509596 because it
was unused. This patch restores it, with a comment to prevent future
deletion.

Bug: v8:11368
Change-Id: Iebec7e14b92e9a0fccc08f2f1c85d8ff4d6173f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2658037Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72453}
parent f128a1c5
......@@ -1829,6 +1829,15 @@ bool RegExpParser::ParseRegExp(Isolate* isolate, Zone* zone,
return success;
}
bool RegExpParser::VerifyRegExpSyntax(Isolate* isolate, Zone* zone,
FlatStringReader* input,
JSRegExp::Flags flags,
RegExpCompileData* result,
const DisallowGarbageCollection& no_gc) {
RegExpParser parser(input, flags, isolate, zone);
return parser.Parse(result, no_gc);
}
RegExpBuilder::RegExpBuilder(Zone* zone, JSRegExp::Flags flags)
: zone_(zone),
pending_empty_(false),
......
......@@ -160,6 +160,12 @@ class V8_EXPORT_PRIVATE RegExpParser {
static bool ParseRegExp(Isolate* isolate, Zone* zone, FlatStringReader* input,
JSRegExp::Flags flags, RegExpCompileData* result);
// Used by the SpiderMonkey embedding of irregexp.
static bool VerifyRegExpSyntax(Isolate* isolate, Zone* zone,
FlatStringReader* input, JSRegExp::Flags flags,
RegExpCompileData* result,
const DisallowGarbageCollection& nogc);
private:
bool Parse(RegExpCompileData* result, const DisallowGarbageCollection&);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment