Skip to content

Commit

Permalink
v0.6.0
Browse files Browse the repository at this point in the history
* Removed try catch from emit to allow bubbling up of errors to process, if one is thrown C2FO#93
    * This also fixed issue C2FO#92 where a loop was entered when `this.emit("error")` was called.
* Added new tests
  • Loading branch information
doug-martin committed Mar 13, 2015
1 parent 9eb3d29 commit 3a5d376
Show file tree
Hide file tree
Showing 7 changed files with 40,104 additions and 35 deletions.
6 changes: 6 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.6.0

* Removed try catch from emit to allow bubbling up of errors to process, if one is thrown [#93](https://github.com/C2FO/fast-csv/issues/93)
* This also fixed issue [#92](https://github.com/C2FO/fast-csv/issues/92) where a loop was entered when `this.emit("error")` was called.
* Added new tests

# v0.5.7

* Strict record handling [#53](https://github.com/C2FO/fast-csv/pull/53) - [@derjust](https://github.com/derjust)
Expand Down
8 changes: 8 additions & 0 deletions docs/History.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@



<h1>v0.6.0</h1>
<ul>
<li>Removed try catch from emit to allow bubbling up of errors to process, if one is thrown <a href="https://github.com/C2FO/fast-csv/issues/93">#93</a><ul>
<li>This also fixed issue <a href="https://github.com/C2FO/fast-csv/issues/92">#92</a> where a loop was entered when <code>this.emit(&quot;error&quot;)</code> was called.</li>
</ul>
</li>
<li>Added new tests</li>
</ul>
<h1>v0.5.7</h1>
<ul>
<li>Strict record handling <a href="https://github.com/C2FO/fast-csv/pull/53">#53</a> - <a href="https://github.com/derjust">@derjust</a></li>
Expand Down
32 changes: 14 additions & 18 deletions lib/parser/parser_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ extended(ParserStream).extend({
val = data[i];
ret[headers[i]] = isUndefined(val) ? '' : val;
}

return orig(ret, cb);
};
}
Expand Down Expand Up @@ -285,25 +285,21 @@ extended(ParserStream).extend({
},

emit: function (event) {
try {
if (event === "end") {
if (!this.__endEmitted) {
this.__endEmitted = true;
spreadArgs(origEmit, ["end", ++this._rowCount], this);
}
} else {
if (!hasIsPaused) {
if (event === "pause") {
this.__paused = true;
} else if (event === "resume") {
this.__paused = false;
this.__flushPausedBuffer();
}
if (event === "end") {
if (!this.__endEmitted) {
this.__endEmitted = true;
spreadArgs(origEmit, ["end", ++this._rowCount], this);
}
} else {
if (!hasIsPaused) {
if (event === "pause") {
this.__paused = true;
} else if (event === "resume") {
this.__paused = false;
this.__flushPausedBuffer();
}
spreadArgs(origEmit, arguments, this);
}
} catch (e) {
this.emit("error", e);
spreadArgs(origEmit, arguments, this);
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19997,5 +19997,5 @@ First1 Last1 [email protected]

"First'1" Last1 [email protected] 1 Street St, State ST, 88888
"First""1" Last1 [email protected] 1 Street St, State ST, 88888
"First""1" Last1 [email protected] 1 Street St, State ST, 88888
"First"1" Last1 [email protected] 1 Street St, State ST, 88888
First1 Last1 [email protected] 1 Street St, State ST, 88888
Loading

0 comments on commit 3a5d376

Please sign in to comment.