OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 // Flags: --predictable |
| 6 |
| 7 const str = '2016-01-02'; |
| 8 |
| 9 function t() { |
| 10 var re; |
| 11 function toDictMode() { |
| 12 for (var i = 0; i < 100; i++) { // Loop is required. |
| 13 re.x = 42; |
| 14 delete re.x; |
| 15 } |
| 16 return 0; |
| 17 } |
| 18 |
| 19 re = /-/g; // Needs to be global to trigger lastIndex accesses. |
| 20 re.lastIndex = { valueOf : toDictMode }; |
| 21 return re.exec(str); |
| 22 } |
| 23 |
| 24 for (var q = 0; q < 10000; q++) { |
| 25 t(); // Needs repetitions to trigger a crash. |
| 26 } |
OLD | NEW |