mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
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:
parent
d07db8d19a
commit
d02d28082c
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user