Bug 1335645 - Part 4 - Fix warning for undeclared variable r=junior

MozReview-Commit-ID: CeCFpLCaOp6

--HG--
extra : rebase_source : 50dd8c9290c8774eb1a119091440356cb5be58f3
This commit is contained in:
Valentin Gosu 2017-02-27 19:16:19 +01:00
parent d07db8d19a
commit d02d28082c

View File

@ -1,7 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//
// HTTP Accept-Language header test
//
"use strict";
Cu.import("resource://gre/modules/NetUtil.jsm");
var testpath = "/bug672448";
@ -45,11 +50,11 @@ function test_accepted_languages() {
let acceptedLanguagesLength = acceptedLanguages.length;
for (let i = 0; i < acceptedLanguagesLength; i++) {
let acceptedLanguage, qualityValue;
let acceptedLanguage, qualityValue, unused;
try {
// The q-value must conform to the definition in HTTP/1.1 Section 3.9.
[_, acceptedLanguage, qualityValue] = acceptedLanguages[i].trim().match(/^([a-z0-9_-]*?)(?:;q=(1(?:\.0{0,3})?|0(?:\.[0-9]{0,3})))?$/i);
[unused, acceptedLanguage, qualityValue] = acceptedLanguages[i].trim().match(/^([a-z0-9_-]*?)(?:;q=(1(?:\.0{0,3})?|0(?:\.[0-9]{0,3})))?$/i);
} catch(e) {
do_throw("Invalid language tag or quality value: " + e);
}