diff options
Diffstat (limited to 'test/js-unittest/b_147664838.js')
-rw-r--r-- | test/js-unittest/b_147664838.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/js-unittest/b_147664838.js b/test/js-unittest/b_147664838.js new file mode 100644 index 0000000..d1d8b72 --- /dev/null +++ b/test/js-unittest/b_147664838.js @@ -0,0 +1,21 @@ +function FindProxyForURL(url, host){ + let re = /x/y; + let cnt = 0; + let str = re[Symbol.replace]("x", { + toString: () => { + cnt++; + if (cnt == 2) { + re.lastIndex = {valueOf: () => { + re.x = 42; + return 0; + }}; + } + return 'y$'; + } + }); + if (str != "y$") { + throw "regex mutated"; + return "FAIL"; + } + return "DIRECT"; +}
\ No newline at end of file |