mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 22:23:21 -04:00
Changed let scope, added undefined check.
This commit is contained in:
parent
2d5464612c
commit
c7aaee6dbc
@ -41,7 +41,8 @@ let printAllNames = false;
|
|||||||
const printNameWhitelist = {};
|
const printNameWhitelist = {};
|
||||||
const printNameBlacklist = {};
|
const printNameBlacklist = {};
|
||||||
(function() {
|
(function() {
|
||||||
for(let i = 0; i < args.length; i++) {
|
let i = 0;
|
||||||
|
for(i = 0; i < args.length; i++) {
|
||||||
const option = args[i];
|
const option = args[i];
|
||||||
if(!/^-/.test(option)) break;
|
if(!/^-/.test(option)) break;
|
||||||
if(option === "--dump-all") {
|
if(option === "--dump-all") {
|
||||||
@ -180,6 +181,6 @@ function shouldDump(name, direction) {
|
|||||||
return matches(printNameWhitelist[name]);
|
return matches(printNameWhitelist[name]);
|
||||||
|
|
||||||
function matches(result) {
|
function matches(result) {
|
||||||
return result !== null && result.indexOf(direction) !== -1;
|
return result !== undefined && result !== null && result.indexOf(direction) !== -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user