57bc75fb98
It was shipped in Chrome 64. Bug: v8:4743 Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: I1084f55d19c0370d344acedeab630f03c02f49e5 Reviewed-on: https://chromium-review.googlesource.com/1086799 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Mathias Bynens <mathias@chromium.org> Cr-Commit-Position: refs/heads/master@{#53514}
27 lines
968 B
JavaScript
27 lines
968 B
JavaScript
// Copyright 2011 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.
|
|
|
|
assertThrows("/[\\p]/u");
|
|
assertThrows("/[\\p{garbage}]/u");
|
|
assertThrows("/[\\p{}]/u");
|
|
assertThrows("/[\\p{]/u");
|
|
assertThrows("/[\\p}]/u");
|
|
assertThrows("/^[\\p{Lu}-\\p{Ll}]+$/u");
|
|
|
|
assertTrue(/^[\p{Lu}\p{Ll}]+$/u.test("ABCabc"));
|
|
assertTrue(/^[\p{Lu}-]+$/u.test("ABC-"));
|
|
assertFalse(/^[\P{Lu}\p{Ll}]+$/u.test("ABCabc"));
|
|
assertTrue(/^[\P{Lu}\p{Ll}]+$/u.test("abc"));
|
|
assertTrue(/^[\P{Lu}]+$/u.test("abc123"));
|
|
assertFalse(/^[\P{Lu}]+$/u.test("XYZ"));
|
|
assertTrue(/[\p{Math}]/u.test("+"));
|
|
assertTrue(/[\P{Bidi_M}]/u.test(" "));
|
|
assertTrue(/[\p{Hex}]/u.test("A"));
|
|
|
|
assertTrue(/^[^\P{Lu}]+$/u.test("XYZ"));
|
|
assertFalse(/^[^\p{Lu}\p{Ll}]+$/u.test("abc"));
|
|
assertFalse(/^[^\p{Lu}\p{Ll}]+$/u.test("ABC"));
|
|
assertTrue(/^[^\p{Lu}\p{Ll}]+$/u.test("123"));
|
|
assertTrue(/^[^\p{Lu}\P{Ll}]+$/u.test("abc"));
|