PDFjs was written in JS from day one, and (as far as I know) was not based on any previous PDF reader.
BTW, I didn't mean they necessarily used the actual Foxit code, but it was a starting point maybe reimplemented in JS.