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 testToUint32InSplit() { |
| 10 var re; |
| 11 function toDictMode() { |
| 12 re.x = 42; |
| 13 delete re.x; |
| 14 return "def"; |
| 15 } |
| 16 |
| 17 re = /./g; // Needs to be global to trigger lastIndex accesses. |
| 18 return re[Symbol.replace]("abc", { valueOf: toDictMode }); |
| 19 } |
| 20 |
| 21 function testToStringInReplace() { |
| 22 var re; |
| 23 function toDictMode() { |
| 24 re.x = 42; |
| 25 delete re.x; |
| 26 return 42; |
| 27 } |
| 28 |
| 29 re = /./g; // Needs to be global to trigger lastIndex accesses. |
| 30 return re[Symbol.split]("abc", { valueOf: toDictMode }); |
| 31 } |
| 32 |
| 33 testToUint32InSplit(); |
| 34 testToStringInReplace(); |
OLD | NEW |