forked from mirrors/gecko-dev
Bug 1811645 - avoid an American English colloquialism meaning "nonsense" r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D175802
This commit is contained in:
parent
96a660c057
commit
f0596227b1
11 changed files with 32 additions and 20 deletions
|
|
@ -418,7 +418,7 @@ trackResourcePrefix("gre");
|
||||||
trackResourcePrefix("app");
|
trackResourcePrefix("app");
|
||||||
|
|
||||||
function getBaseUriForChromeUri(chromeUri) {
|
function getBaseUriForChromeUri(chromeUri) {
|
||||||
let chromeFile = chromeUri + "gobbledygooknonexistentfile.reallynothere";
|
let chromeFile = chromeUri + "nonexistentfile.reallynothere";
|
||||||
let uri = Services.io.newURI(chromeFile);
|
let uri = Services.io.newURI(chromeFile);
|
||||||
let fileUri = gChromeReg.convertChromeURL(uri);
|
let fileUri = gChromeReg.convertChromeURL(uri);
|
||||||
return fileUri.resolve(".");
|
return fileUri.resolve(".");
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ trackResourcePrefix("gre");
|
||||||
trackResourcePrefix("app");
|
trackResourcePrefix("app");
|
||||||
|
|
||||||
function getBaseUriForChromeUri(chromeUri) {
|
function getBaseUriForChromeUri(chromeUri) {
|
||||||
let chromeFile = chromeUri + "gobbledygooknonexistentfile.reallynothere";
|
let chromeFile = chromeUri + "nonexistentfile.reallynothere";
|
||||||
let uri = Services.io.newURI(chromeFile);
|
let uri = Services.io.newURI(chromeFile);
|
||||||
let fileUri = gChromeReg.convertChromeURL(uri);
|
let fileUri = gChromeReg.convertChromeURL(uri);
|
||||||
return fileUri.resolve(".");
|
return fileUri.resolve(".");
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,12 @@ var pairs = [
|
||||||
let supportsNullBytes = AppConstants.platform == "macosx";
|
let supportsNullBytes = AppConstants.platform == "macosx";
|
||||||
// Note that \u000d (\r) is missing here; we test it separately because it
|
// Note that \u000d (\r) is missing here; we test it separately because it
|
||||||
// makes the test sad on Windows.
|
// makes the test sad on Windows.
|
||||||
let gobbledygook =
|
let nonsense =
|
||||||
"\u000a\u000b\u000c\u000e\u000f\u0010\u0011\u0012\u0013\u0014javascript:foo";
|
"\u000a\u000b\u000c\u000e\u000f\u0010\u0011\u0012\u0013\u0014javascript:foo";
|
||||||
if (supportsNullBytes) {
|
if (supportsNullBytes) {
|
||||||
gobbledygook = "\u0000" + gobbledygook;
|
nonsense = "\u0000" + nonsense;
|
||||||
}
|
}
|
||||||
pairs.push([gobbledygook, "foo"]);
|
pairs.push([nonsense, "foo"]);
|
||||||
|
|
||||||
let supportsReturnWithoutNewline =
|
let supportsReturnWithoutNewline =
|
||||||
AppConstants.platform != "win" && AppConstants.platform != "linux";
|
AppConstants.platform != "win" && AppConstants.platform != "linux";
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,8 @@ var data = [
|
||||||
fixed: "http://user:pass@example.com:8080/this/is/a/test.html",
|
fixed: "http://user:pass@example.com:8080/this/is/a/test.html",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
wrong: "gobbledygook:user:pass@example.com:8080/this/is/a/test.html",
|
wrong: "nonsense:user:pass@example.com:8080/this/is/a/test.html",
|
||||||
fixed:
|
fixed: "http://nonsense:user%3Apass@example.com:8080/this/is/a/test.html",
|
||||||
"http://gobbledygook:user%3Apass@example.com:8080/this/is/a/test.html",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
wrong: "user:@example.com:8080/this/is/a/test.html",
|
wrong: "user:@example.com:8080/this/is/a/test.html",
|
||||||
|
|
|
||||||
|
|
@ -350,7 +350,7 @@ add_task(async function test_missing_file() {
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_hasSource() {
|
add_task(async function test_hasSource() {
|
||||||
equal(l10nReg.hasSource("gobbledygook"), false, "Non-existing source doesn't exist");
|
equal(l10nReg.hasSource("nonsense"), false, "Non-existing source doesn't exist");
|
||||||
equal(l10nReg.hasSource("app"), false, "hasSource returns true before registering a source");
|
equal(l10nReg.hasSource("app"), false, "hasSource returns true before registering a source");
|
||||||
let oneSource = new L10nFileSource("app", "app", ["en-US"], "/{locale}/");
|
let oneSource = new L10nFileSource("app", "app", ["en-US"], "/{locale}/");
|
||||||
l10nReg.registerSources([oneSource]);
|
l10nReg.registerSources([oneSource]);
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ class Tainted {
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
/*
|
/*
|
||||||
* This section contains non-user-facing C++ gobblygook to support
|
* This section contains obscure, non-user-facing C++ to support
|
||||||
* variable-argument macros.
|
* variable-argument macros.
|
||||||
*/
|
*/
|
||||||
#define MOZ_TAINT_GLUE(a, b) a b
|
#define MOZ_TAINT_GLUE(a, b) a b
|
||||||
|
|
|
||||||
|
|
@ -329,3 +329,16 @@ avoid-blacklist-and-whitelist:
|
||||||
# Disable for now. Needs some dev to handle this
|
# Disable for now. Needs some dev to handle this
|
||||||
# avoid-master-and-slave:
|
# avoid-master-and-slave:
|
||||||
# description: "Use words like 'controller', 'worker' instead"
|
# description: "Use words like 'controller', 'worker' instead"
|
||||||
|
---
|
||||||
|
avoid-gobbledygook:
|
||||||
|
description: "American English colloquialism. Use 'nonsense' instead."
|
||||||
|
level: error
|
||||||
|
include: ['.']
|
||||||
|
type: regex
|
||||||
|
payload: \b(gobbledy)?-?gook
|
||||||
|
ignore-case: true
|
||||||
|
exclude:
|
||||||
|
- extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/orig/en_US-custom.dic
|
||||||
|
- extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/utf8/en-US-utf8.dic
|
||||||
|
- extensions/spellcheck/locales/en-US/hunspell/en-US.dic
|
||||||
|
- tools/lint/rejected-words.yml
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ add_task(async function test_enforce_useful_extension() {
|
||||||
await testLinkWithoutExtension("video/webm", true);
|
await testLinkWithoutExtension("video/webm", true);
|
||||||
await testLinkWithoutExtension("application/pdf", true);
|
await testLinkWithoutExtension("application/pdf", true);
|
||||||
|
|
||||||
await testLinkWithoutExtension("application/x-gobbledygook", false);
|
await testLinkWithoutExtension("application/x-nonsense", false);
|
||||||
await testLinkWithoutExtension("application/octet-stream", false);
|
await testLinkWithoutExtension("application/octet-stream", false);
|
||||||
await testLinkWithoutExtension("binary/octet-stream", false);
|
await testLinkWithoutExtension("binary/octet-stream", false);
|
||||||
await testLinkWithoutExtension("application/x-msdownload", false);
|
await testLinkWithoutExtension("application/x-msdownload", false);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ let types = {
|
||||||
// so it is used here for this test.
|
// so it is used here for this test.
|
||||||
js: "application/x-javascript",
|
js: "application/x-javascript",
|
||||||
binary: "application/octet-stream",
|
binary: "application/octet-stream",
|
||||||
gook: "application/x-gook",
|
nonsense: "application/x-nonsense",
|
||||||
zip: "application/zip",
|
zip: "application/zip",
|
||||||
json: "application/json",
|
json: "application/json",
|
||||||
tar: "application/x-tar",
|
tar: "application/x-tar",
|
||||||
|
|
|
||||||
|
|
@ -73,16 +73,16 @@
|
||||||
<img id="i18" src="http://localhost:8000/save_filename.sjs?type=png&filename=second%32file%2Eexe" data-filename="second2file.png">
|
<img id="i18" src="http://localhost:8000/save_filename.sjs?type=png&filename=second%32file%2Eexe" data-filename="second2file.png">
|
||||||
|
|
||||||
<!-- unknown type with png extension -->
|
<!-- unknown type with png extension -->
|
||||||
<img id="i19" src="http://localhost:8000/save_filename.sjs?type=gook&filename=gook1.png"
|
<img id="i19" src="http://localhost:8000/save_filename.sjs?type=nonsense&filename=nonsense1.png"
|
||||||
data-nodrag="true" data-unknown="typeonly" data-filename="gook1.png">
|
data-nodrag="true" data-unknown="typeonly" data-filename="nonsense1.png">
|
||||||
|
|
||||||
<!-- unknown type with exe extension -->
|
<!-- unknown type with exe extension -->
|
||||||
<img id="i20" src="http://localhost:8000/save_filename.sjs?type=gook&filename=gook2.exe"
|
<img id="i20" src="http://localhost:8000/save_filename.sjs?type=nonsense&filename=nonsense2.exe"
|
||||||
data-nodrag="true" data-unknown="typeonly" data-filename="gook2.exe">
|
data-nodrag="true" data-unknown="typeonly" data-filename="nonsense2.exe">
|
||||||
|
|
||||||
<!-- unknown type with no extension -->
|
<!-- unknown type with no extension -->
|
||||||
<img id="i21" src="http://localhost:8000/save_filename.sjs?type=gook&filename=gook3"
|
<img id="i21" src="http://localhost:8000/save_filename.sjs?type=nonsense&filename=nonsense3"
|
||||||
data-nodrag="true" data-unknown="typeonly" data-filename="gook3">
|
data-nodrag="true" data-unknown="typeonly" data-filename="nonsense3">
|
||||||
|
|
||||||
<!-- simple script -->
|
<!-- simple script -->
|
||||||
<script id="i22" src="http://localhost:8000/save_filename.sjs?type=js&filename=script1.js" data-filename="script1.js"></script>
|
<script id="i22" src="http://localhost:8000/save_filename.sjs?type=js&filename=script1.js" data-filename="script1.js"></script>
|
||||||
|
|
@ -290,7 +290,7 @@
|
||||||
data-unknown="true"></object>
|
data-unknown="true"></object>
|
||||||
|
|
||||||
<!-- executable with no filename specified and an extension specified within the url -->
|
<!-- executable with no filename specified and an extension specified within the url -->
|
||||||
<img id="i76" src="http://localhost:8000/executable.exe?type=gook"
|
<img id="i76" src="http://localhost:8000/executable.exe?type=nonsense"
|
||||||
data-nodrag="true" data-unknown="typeonly" data-filename="executable.exe">
|
data-nodrag="true" data-unknown="typeonly" data-filename="executable.exe">
|
||||||
|
|
||||||
<!-- embedded child html -->
|
<!-- embedded child html -->
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
add_task(async function test_utf8_extension() {
|
add_task(async function test_utf8_extension() {
|
||||||
const mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
|
const mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
|
||||||
let someMIME = mimeService.getFromTypeAndExtension(
|
let someMIME = mimeService.getFromTypeAndExtension(
|
||||||
"application/x-gobbledygook",
|
"application/x-nonsense",
|
||||||
".тест"
|
".тест"
|
||||||
);
|
);
|
||||||
Assert.stringContains(someMIME.description, "тест");
|
Assert.stringContains(someMIME.description, "тест");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue