Skip to content

Commit

Permalink
Remove dead JS code (#9136)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbynek committed Apr 8, 2024
1 parent 97a44a4 commit 89c7754
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 47 deletions.
11 changes: 0 additions & 11 deletions war/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,14 @@ module.exports = {
curly: "error",
},
globals: {
$: "readonly",
$$: "readonly",
$A: "readonly",
applyTooltip: "readonly",
Ajax: "readonly",
Atomics: "readonly",
AutoScroller: "readonly",
Behaviour: "readonly",
breadcrumbs: "readonly",
buildFormTree: "readonly",
CodeMirror: "readonly",
ComboBox: "readonly",
COMBOBOX_VERSION: "writeable",
createFilterMenuButton: "readonly",
createSearchBox: "readonly",
crumb: "readonly",
dialog: "readonly",
Expand All @@ -40,8 +34,6 @@ module.exports = {
fireEvent: "readonly",
Form: "readonly",
getElementOverflowParams: "readonly",
global: "readonly",
Hash: "readonly",
hoverNotification: "readonly",
iota: "writeable",
isInsideRemovable: "readonly",
Expand All @@ -54,14 +46,12 @@ module.exports = {
object: "readonly",
objectToUrlFormEncoded: "readonly",
onSetupWizardInitialized: "readonly",
Prototype: "readonly",
refillOnChange: "readonly",
refreshPart: "readonly",
registerSortableDragDrop: "readonly",
renderOnDemand: "readonly",
rootURL: "readonly",
safeValidateButton: "readonly",
section: "readonly",
setupWizardExtensions: "readonly",
SharedArrayBuffer: "readonly",
shortenName: "readonly",
Expand All @@ -72,6 +62,5 @@ module.exports = {
Utilities: "readonly",
UTILITIES_VERSION: "writeable",
YAHOO: "readonly",
YUI: "readonly",
},
};
43 changes: 7 additions & 36 deletions war/src/main/webapp/scripts/hudson-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,15 +590,10 @@ function parseHtml(html) {

/**
* Evaluates the script in global context.
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#direct_and_indirect_eval
*/
function geval(script) {
// execScript chokes on "" but eval doesn't, so we need to reject it first.
if (script == null || script == "") {
return;
}
// see http://perfectionkills.com/global-eval-what-are-the-options/
// note that execScript cannot return value
(this.execScript || eval)(script);
eval(script);
}

/**
Expand Down Expand Up @@ -675,17 +670,9 @@ function registerValidator(e) {
try {
return eval(url); // need access to 'this', so no 'geval'
} catch (e) {
if (window.console != null) {
console.warn(
"Legacy checkUrl '" + url + "' is not valid JavaScript: " + e,
);
}
if (window.YUI != null) {
YUI.log(
"Legacy checkUrl '" + url + "' is not valid JavaScript: " + e,
"warn",
);
}
console.warn(
"Legacy checkUrl '" + url + "' is not valid JavaScript: " + e,
);
return url; // return plain url as fallback
}
} else {
Expand Down Expand Up @@ -750,15 +737,7 @@ function registerValidator(e) {
TryEach(function (name) {
var c = findNearBy(e, name);
if (c == null) {
if (window.console != null) {
console.warn("Unable to find nearby " + name);
}
if (window.YUI != null) {
YUI.log(
"Unable to find a nearby control of the name " + name,
"warn",
);
}
console.warn("Unable to find nearby " + name);
return;
}
c.addEventListener("change", checker.bind(e));
Expand Down Expand Up @@ -1902,15 +1881,7 @@ function refillOnChange(e, onChange) {
TryEach(function (name) {
var c = findNearBy(e, name);
if (c == null) {
if (window.console != null) {
console.warn("Unable to find nearby " + name);
}
if (window.YUI != null) {
YUI.log(
"Unable to find a nearby control of the name " + name,
"warn",
);
}
console.warn("Unable to find nearby " + name);
return;
}
c.addEventListener("change", h);
Expand Down

0 comments on commit 89c7754

Please sign in to comment.