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 // Changes the map of obj. |
| 6 function mutateObjectOnStringConversion(obj) { |
| 7 return { toString: () => { obj.x = 42;return "";}}; |
| 8 } |
| 9 |
| 10 { |
| 11 const re = /./; |
| 12 re.exec(mutateObjectOnStringConversion(re)); |
| 13 } |
| 14 |
| 15 { |
| 16 const re = /./; |
| 17 re.test(mutateObjectOnStringConversion(re)); |
| 18 } |
| 19 |
| 20 { |
| 21 const re = /./; |
| 22 re[Symbol.match](mutateObjectOnStringConversion(re)); |
| 23 } |
| 24 |
| 25 { |
| 26 const re = /./; |
| 27 re[Symbol.search](mutateObjectOnStringConversion(re)); |
| 28 } |
| 29 |
| 30 { |
| 31 const re = /./; |
| 32 re[Symbol.split](mutateObjectOnStringConversion(re)); |
| 33 } |
| 34 |
| 35 { |
| 36 const re = /./; |
| 37 re[Symbol.replace](mutateObjectOnStringConversion(re)); |
| 38 } |
OLD | NEW |