OLD | NEW |
| (Empty) |
1 // Copyright 2015 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Should not time out. Running time 0.5s vs. 120s before the change. | |
6 function collapse() { | |
7 var src = "(?:"; | |
8 for (var i = 128; i < 0x1000; i++) { | |
9 src += "a" + String.fromCharCode(i) + "|"; | |
10 } | |
11 src += "aa)"; | |
12 var collapsible = new RegExp(src); | |
13 var subject = "zzzzzzz" + String.fromCharCode(3000); | |
14 for (var i = 0; i < 1000; i++) { | |
15 subject += "xxxxxxx"; | |
16 } | |
17 for (var i = 0; i < 2000; i++) { | |
18 assertFalse(collapsible.test(subject)); | |
19 } | |
20 } | |
21 | |
22 collapse(); | |
OLD | NEW |