FANDOM


(Created page with "same as any other lang: by tracing execution path up (or down, in this case) to the problem. step-by-step it was: #error message (invalid...) have been returned by "dateerror"...")
 
 
Line 3: Line 3:
 
##that means the error was somewhere before the function
 
##that means the error was somewhere before the function
 
#there are 9 calls of the fn, so i have to find what exact call produces the error
 
#there are 9 calls of the fn, so i have to find what exact call produces the error
##in order to do this, i would set log(1-9) right before the fn, but i n this case i just added param to fn: dateerror(1-9), so fn have returned "invalid... 1"
+
##in order to do this, i would set log(1-9) right before the fn, but in this case i just added param to fn: dateerror(1-9), so fn have returned "invalid... 1"
 
##so problem was somewhere before the "if parts..."
 
##so problem was somewhere before the "if parts..."
 
#there is only one meaningful line before it: the .split one
 
#there is only one meaningful line before it: the .split one

Latest revision as of 23:07, February 2, 2020

same as any other lang: by tracing execution path up (or down, in this case) to the problem. step-by-step it was:

  1. error message (invalid...) have been returned by "dateerror" function
    1. that means the error was somewhere before the function
  2. there are 9 calls of the fn, so i have to find what exact call produces the error
    1. in order to do this, i would set log(1-9) right before the fn, but in this case i just added param to fn: dateerror(1-9), so fn have returned "invalid... 1"
    2. so problem was somewhere before the "if parts..."
  3. there is only one meaningful line before it: the .split one
  4. there is only two reasons to fail .split: bad date and bad pattern
    1. i have supplied good date, so the problem was with the pattern
  5. quick test in the console (...split('1/1/1',...)...) shows empty values in the resulting table, along with bad table length
    1. the problem definetely in the pattern
  6. i did re-read the docs about ansi and utf patterns and tried another way to write the pattern
    1. it have worked
    2. both ways supposed to work
      1. fandom's text library has bugs
Community content is available under CC-BY-SA unless otherwise noted.