Skip to content

Commit

Permalink
Rollup merge of rust-lang#90530 - GuillaumeGomez:simplify-js-tester, …
Browse files Browse the repository at this point in the history
…r=notriddle

Simplify js tester a bit

r? ```@notriddle```
  • Loading branch information
matthiaskrgr authored Nov 4, 2021
2 parents 4961b10 + 3f496b5 commit e6368c3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/tools/rustdoc-js/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ function parseOptions(args) {
"test_folder": "",
"test_file": "",
};
var correspondances = {
var correspondences = {
"--resource-suffix": "resource_suffix",
"--doc-folder": "doc_folder",
"--test-folder": "test_folder",
Expand All @@ -423,17 +423,13 @@ function parseOptions(args) {
};

for (var i = 0; i < args.length; ++i) {
if (args[i] === "--resource-suffix"
|| args[i] === "--doc-folder"
|| args[i] === "--test-folder"
|| args[i] === "--test-file"
|| args[i] === "--crate-name") {
if (correspondences.hasOwnProperty(args[i])) {
i += 1;
if (i >= args.length) {
console.log("Missing argument after `" + args[i - 1] + "` option.");
return null;
}
opts[correspondances[args[i - 1]]] = args[i];
opts[correspondences[args[i - 1]]] = args[i];
} else if (args[i] === "--help") {
showHelp();
process.exit(0);
Expand Down

0 comments on commit e6368c3

Please sign in to comment.