Skip to content

Loading…

avoid eval if the row is returned as an array #594

Merged
merged 1 commit into from

2 participants

@lukemurray

Fix for issue 593

@lukemurray

Hmm it looks like npm install failed on the node 0.8 build? Did I read that correctly?

@brianc
Owner

kicking the build off again - probably a temporary npm issue

@brianc
Owner

Thanks for the PR! Good catch too :clap:

I'll close the issue related to this & just track this from here for now. I'll try to get a new patch version out today.

@brianc
Owner

just gonna merge it. dumb npm bug preventing install on v0.8.x in travis

@brianc brianc merged commit f8df873 into brianc:master

1 check failed

Details continuous-integration/travis-ci The Travis CI build could not complete due to an error
@lukemurray

Awesome. Thanks

@brianc
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 20, 2014
  1. @lukemurray
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/result.js
View
7 lib/result.js
@@ -11,7 +11,8 @@ var Result = function(rowMode) {
this.fields = [];
this._parsers = [];
this.RowCtor = null;
- if(rowMode == "array") {
+ this.rowAsArray = rowMode == "array";
+ if(this.rowAsArray) {
this.parseRow = this._parseRowAsArray;
}
};
@@ -93,7 +94,9 @@ Result.prototype.addFields = function(fieldDescriptions) {
//results in ~60% speedup on large query result sets
ctorBody += inlineParser(desc.name, i);
}
- this.RowCtor = Function("parsers", "rowData", ctorBody);
+ if(!this.rowAsArray) {
+ this.RowCtor = Function("parsers", "rowData", ctorBody);
+ }
};
module.exports = Result;
Something went wrong with that request. Please try again.