v8/test/mjsunit/regress/regress-v8-13410.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
771 B
JavaScript
Raw Normal View History

// 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'));