Skip to content

Commit

Permalink
[java] removed the broken escape (#11110)
Browse files Browse the repository at this point in the history
removed the broken escape

The quote marks were replaced by identical quote marks to escape them.
This is an unnecessary operation, as the resulting string will be
identical to the original string.
  • Loading branch information
joerg1985 authored Oct 12, 2022
1 parent 0cceb8a commit 7a20400
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
6 changes: 0 additions & 6 deletions java/src/org/openqa/selenium/remote/RemoteWebDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,6 @@ public Object executeScript(String script, Object... args) {
"You must be using an underlying instance of WebDriver that supports executing javascript");
}

// Escape the quote marks
script = script.replaceAll("\"", "\\\"");

List<Object> convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect(
Collectors.toList());

Expand All @@ -488,9 +485,6 @@ public Object executeAsyncScript(String script, Object... args) {
"WebDriver that supports executing javascript");
}

// Escape the quote marks
script = script.replaceAll("\"", "\\\"");

List<Object> convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect(
Collectors.toList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,6 @@ private List<String> stringToUtf8Array(String toConvert) {
}

private Map<String, ?> toScript(String script, Object... args) {
// Escape the quote marks
script = script.replaceAll("\"", "\\\"");

List<Object> convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect(
Collectors.toList());

Expand Down

0 comments on commit 7a20400

Please sign in to comment.