From 889e3318dcc62843ff8b3520d83011baa34b914d Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Sun, 1 Mar 2015 09:51:33 +0900 Subject: [PATCH] Bug 1108382 - Part 5: Do not use non-standard flag argument of String.prototype.replace in docshell/test/unit/. r=gavin --- docshell/test/unit/test_nsDefaultURIFixup_info.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docshell/test/unit/test_nsDefaultURIFixup_info.js b/docshell/test/unit/test_nsDefaultURIFixup_info.js index b178ea95653a..6fc899d5675c 100644 --- a/docshell/test/unit/test_nsDefaultURIFixup_info.js +++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js @@ -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);