d42534d441
Both of these features were shipped in Chrome 62. Bug: v8:4545, v8:6172 Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng Change-Id: Ie00dcbeded7517a15696d4a78fcfbbf162919923 Reviewed-on: https://chromium-review.googlesource.com/775601 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Adam Klein <adamk@chromium.org> Cr-Commit-Position: refs/heads/master@{#49453}
28 lines
782 B
JavaScript
28 lines
782 B
JavaScript
// Copyright 2017 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.
|
|
|
|
// Flags: --regexp-mode-modifiers
|
|
|
|
// S flag switches dotall mode on and off. Combine with i flag changes to test
|
|
// the parser.
|
|
test(/.(?s).(?i-s).a(?-i)a/);
|
|
test(/.(?s:.)(?i:.a)a/);
|
|
test(/.(?s).(?i-s).a(?-i)a/u);
|
|
test(/.(?s:.)(?i:.a)a/u);
|
|
|
|
// m flag makes no difference
|
|
test(/.(?sm).(?i-s).a(?-i)a/);
|
|
test(/.(?s:.)(?i:.a)a/);
|
|
test(/.(?sm).(?im-s).a(?m-i)a/u);
|
|
test(/.(?s:.)(?i:.a)a/u);
|
|
|
|
function test(re) {
|
|
assertTrue(re.test("...aa"));
|
|
assertTrue(re.test(".\n.aa"));
|
|
assertTrue(re.test(".\n.Aa"));
|
|
assertFalse(re.test("\n\n.Aa"));
|
|
assertFalse(re.test(".\n\nAa"));
|
|
assertFalse(re.test(".\n.AA"));
|
|
}
|