mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Backed out changeset 2a44daf61d7f (bug 1640479) for build bustages on bug1640479.js. CLOSED TREE
This commit is contained in:
parent
e7258ec672
commit
5c6bd8bcfd
@ -1,13 +0,0 @@
|
||||
var failures = 0;
|
||||
var i = 0;
|
||||
|
||||
function foo() {
|
||||
var e;
|
||||
var r = RegExp("(?<_" + (i++) + "a>)");
|
||||
try { e = r.exec("a"); } catch {}
|
||||
e = r.exec("a");
|
||||
if (e.groups === undefined) failures++;
|
||||
}
|
||||
|
||||
oomTest(foo);
|
||||
assertEq(failures, 0);
|
@ -480,16 +480,16 @@ bool CompilePattern(JSContext* cx, MutableHandleRegExpShared re,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Add one to account for the whole-match capture
|
||||
uint32_t pairCount = data.capture_count + 1;
|
||||
re->useRegExpMatch(pairCount);
|
||||
|
||||
if (!data.capture_name_map.is_null()) {
|
||||
RootedNativeObject namedCaptures(cx, data.capture_name_map->inner());
|
||||
if (!RegExpShared::initializeNamedCaptures(cx, re, namedCaptures)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// All fallible initialization has succeeded, so we can change state.
|
||||
// Add one to capture_count to account for the whole-match capture.
|
||||
uint32_t pairCount = data.capture_count + 1;
|
||||
re->useRegExpMatch(pairCount);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(re->kind() == RegExpShared::Kind::RegExp);
|
||||
|
@ -1137,6 +1137,7 @@ void RegExpShared::useRegExpMatch(size_t pairCount) {
|
||||
/* static */
|
||||
bool RegExpShared::initializeNamedCaptures(JSContext* cx, HandleRegExpShared re,
|
||||
HandleNativeObject namedCaptures) {
|
||||
MOZ_ASSERT(re->kind() == RegExpShared::Kind::RegExp);
|
||||
MOZ_ASSERT(!re->groupsTemplate_);
|
||||
MOZ_ASSERT(!re->namedCaptureIndices_);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user