Skip to content
Snippets Groups Projects
Commit f832ff9a authored by samronning's avatar samronning
Browse files

Bug 1786402 - Fix ESLint rule warnings for no-unused-vars in...

Bug 1786402 - Fix ESLint rule warnings for no-unused-vars in intl/uconv/tests/unit/test_bug340714.js r=hsivonen

Differential Revision: https://phabricator.services.mozilla.com/D155290
parent 098258b7
No related branches found
No related tags found
No related merge requests found
......@@ -176,7 +176,6 @@ module.exports = {
// per bug.
"extensions/permissions/**",
"image/test/unit/**",
"intl/uconv/tests/unit/test_bug340714.js",
"modules/libjar/test/unit/test_empty_jar_telemetry.js",
"modules/libjar/zipwriter/test/unit/test_alignment.js",
"modules/libjar/zipwriter/test/unit/test_bug419769_2.js",
......
......@@ -28,16 +28,10 @@ registerCleanupFunction(() => {
});
function makeText(withBOM, charset) {
// eslint-disable-next-line no-eval
var theText = eval("sample" + charset);
if (withBOM) {
if (charset == "UTF16BE") {
theText = beBOM + theText;
} else {
theText = leBOM + theText;
}
}
return theText;
const isBE = charset === "UTF16BE";
const sampleText = isBE ? sampleUTF16BE : sampleUTF16LE;
const bom = isBE ? beBOM : leBOM;
return withBOM ? bom + sampleText : sampleText;
}
function testCase(withBOM, charset, charsetDec, decoder, bufferLength) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment