It was the modification I made to how push works. The stalemated subroutine in shogi.txt was using push to create an array of legal moves instead of using the setlegal command. I guess I wrote that subroutine before I created the setlegal command. Anyway, it was putting a null character at the beginning of the legalmoves array, and that threw off the JavaScript code, which didn't know what to do with that null character. So, I made a correction to push to make sure a variable is set before moving its scalar value to the first element of an array, since unset variables have the scalar value of null.
It was the modification I made to how push works. The stalemated subroutine in shogi.txt was using push to create an array of legal moves instead of using the setlegal command. I guess I wrote that subroutine before I created the setlegal command. Anyway, it was putting a null character at the beginning of the legalmoves array, and that threw off the JavaScript code, which didn't know what to do with that null character. So, I made a correction to push to make sure a variable is set before moving its scalar value to the first element of an array, since unset variables have the scalar value of null.