Skip to content

Commit

Permalink
Bug 1108382 - Part 5: Do not use non-standard flag argument of String…
Browse files Browse the repository at this point in the history
….prototype.replace in docshell/test/unit/. r=gavin
  • Loading branch information
arai-a committed Mar 1, 2015
1 parent 0a48a99 commit 889e331
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docshell/test/unit/test_nsDefaultURIFixup_info.js
Expand Up @@ -621,14 +621,14 @@ function do_single_test_run() {
if (couldDoKeywordLookup) {
if (expectKeywordLookup) {
if (!affectedByWhitelist || (affectedByWhitelist && !inWhitelist)) {
let urlparamInput = encodeURIComponent(sanitize(testInput)).replace("%20", "+", "g");
let urlparamInput = encodeURIComponent(sanitize(testInput)).replace(/%20/g, "+");
// If the input starts with `?`, then info.preferredURI.spec will omit it
// In order to test this behaviour, remove `?` only if it is the first character
if (urlparamInput.startsWith("%3F")) {
urlparamInput = urlparamInput.replace("%3F", "");
}
let searchURL = kSearchEngineURL.replace("{searchTerms}", urlparamInput);
let spec = info.preferredURI.spec.replace("%27", "'", "g");
let spec = info.preferredURI.spec.replace(/%27/g, "'");
do_check_eq(spec, searchURL);
} else {
do_check_eq(info.preferredURI, null);
Expand Down

0 comments on commit 889e331

Please sign in to comment.