mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
JavaScript: Deal with (un-)escaping on captured variables.
This commit is contained in:
@@ -83,3 +83,10 @@ function badEncodeWithReplacer(s) {
|
||||
function badRoundtrip(s) {
|
||||
return s.replace(/\\\\/g, "\\").replace(/\\/g, "\\\\");
|
||||
}
|
||||
|
||||
function testWithCapturedVar(x) {
|
||||
var captured = x;
|
||||
(function() {
|
||||
captured = captured.replace(/\\/g, "\\\\");
|
||||
})();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user