Open CreepyCre opened 4 years ago
I believe every argument that is empty should or is skipped. Or at least that's what this line is telling me.
The individual args ending up as null is not an issue here, it will not influence the length. The actual cause is located here. If you check the javadocs for String#split, you will see that without specifying a limit it will default to 0, which will drop any trailing empty Strings. The solution here is to use any negative integer as the limit.
javascript_identifier_
hasargs.length = 1
, whilejavascript_identifier_,
hasargs.length = 0
javascript_identifier_,,somevalue
hasargs.length = 3
, whilejavascript_identifier_somevalue,,
hasargs.length = 1
Expected behaviour would be that
args.length = amount of commas + 1
in every case. It seems that it will only parse arguments until the last argument with a non empty string. Empty arguments should be arguments as well for consistency.