JavaScript: Deal with escape-unescape-escape (and similar) chains.

This commit is contained in:
Max Schaefer
2019-10-30 14:49:01 +00:00
parent 8c133ff61d
commit bb0771b36c
2 changed files with 10 additions and 2 deletions

View File

@@ -130,3 +130,7 @@ function testWithCapturedVar(x) {
captured = captured.replace(/\\/g, "\\\\");
})();
}
function cloneAndStringify(s) {
return JSON.stringify(JSON.parse(JSON.stringify(s)));
}