summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-v8-13410.js
blob: 82b8952f7c5a19c7b278b1475c63acbf80e86fe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2022 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.

// Make sure lone surrogates don't match combined surrogates.
assertFalse(/[\ud800-\udfff]+/u.test('\ud801\udc0f'));

// Surrogate pairs split by an "always succeeding" backref shouldn't match
// combined surrogates.
assertFalse(/(\ud801\1\udc0f)/u.test('\ud801\udc0f'));
assertFalse(/(\ud801\1?\udc0f)/u.test('\ud801\udc0f'));
assertFalse(/(\ud801\1{0}\udc0f)/u.test('\ud801\udc0f'));
assertFalse(new RegExp('(\ud801\\1\udc0f)','u').test('\ud801\udc0f'));
assertFalse(new RegExp('(\ud801\\1?\udc0f)','u').test('\ud801\udc0f'));
assertFalse(new RegExp('(\ud801\\1{0}\udc0f)','u').test('\ud801\udc0f'));