v8/test/mjsunit/regress/regress-1018592.js
Jakob Gruber 5d5a659539 [regexp] Fix invalid DCHECK in named capture logic
The `capture_ix` refers to all captures while `capture_count` only
refers to named captures. Clarified by renaming `capture_count` to
`named_capture_count` and removing the incorrect part of the DCHECK.

The `>= 1` part of the condition must still hold since named captures
can only refer to explicit capture groups, which start at index 1.

Tbr: petermarshall@chromium.org
Bug: chromium:1018592
Change-Id: If8a26f6661ba0483d585f74270b3b4a3853e2ca8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1886810
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64629}
2019-10-30 07:09:24 +00:00

7 lines
235 B
JavaScript

// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const re = /()()()()(?<aaaab>)1/;
"111a1a".replace(re, () => {}) ;