Skip to content

Commit 3e65b98

Browse files
committed
Ensure converter functions are run in the correct order
1 parent f590b5b commit 3e65b98

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/resultset.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,6 @@ class ResultSet {
161161
}
162162
}
163163

164-
// create objects, if desired
165-
if (this._impl.outFormat === constants.OUT_FORMAT_OBJECT) {
166-
for (let i = 0; i < rows.length; i++) {
167-
const origRow = rows[i];
168-
const newRow = rows[i] = {};
169-
const metaData = this._impl.metaData;
170-
for (let j = 0; j < metaData.length; j++) {
171-
newRow[metaData[j].name] = origRow[j];
172-
}
173-
}
174-
}
175-
176164
// run any conversion functions, if applicable
177165
// NOTE: we mark the connection as no longer in progress before making
178166
// calls to the converter function; this is needed to allow calls against
@@ -194,6 +182,18 @@ class ResultSet {
194182
}
195183
}
196184

185+
// create objects, if desired
186+
if (this._impl.outFormat === constants.OUT_FORMAT_OBJECT) {
187+
for (let i = 0; i < rows.length; i++) {
188+
const origRow = rows[i];
189+
const newRow = rows[i] = {};
190+
const metaData = this._impl.metaData;
191+
for (let j = 0; j < metaData.length; j++) {
192+
newRow[metaData[j].name] = origRow[j];
193+
}
194+
}
195+
}
196+
197197
}
198198

199199
//---------------------------------------------------------------------------

0 commit comments

Comments
 (0)