Ad
  • Custom User Avatar

    You're not supposed to give a reader argument to DocumentParser.prototype.parse. You're supposed to call the getChunk() method from the reader instance that is already provided to the constructor of the DocumentParser object.
    So you can perform these changes :

    // replace this
    DocumentParser.prototype.parse = function (reader) {
    // by this :
    DocumentParser.prototype.parse = function () {
    // and, each time you want to call the 'getChunk()' method, use this : 
    this.reader.getChunk()
    

    And then you can implement and test your solution.

    (I let the issue open since it's a strange behavior and most likely truly a bug...)