Skip to content

Commit

Permalink
Make testharness.js escape all backslashes in strings, not just the 1st
Browse files Browse the repository at this point in the history
Change-Id: I0059ca822f3d492be3d8175c8ea0e2fe51fa2cfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1932367
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#732361}
  • Loading branch information
Loirooriol authored and chromium-wpt-export-bot committed Jan 16, 2020
1 parent 740c24d commit d095073
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/testharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ policies and contribution forms [3].

switch (typeof val) {
case "string":
val = val.replace("\\", "\\\\");
val = val.replace(/\\/g, "\\\\");
for (var p in replacements) {
var replace = "\\" + replacements[p];
val = val.replace(RegExp(String.fromCharCode(p), "g"), replace);
Expand Down

0 comments on commit d095073

Please sign in to comment.