File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ var Result = function() {
9
9
this . oid = null ;
10
10
this . rows = [ ] ;
11
11
this . fields = [ ] ;
12
+ this . _parsers = [ ] ;
12
13
} ;
13
14
14
15
var matchRegexp = / ( [ A - Z a - z ] + ) ? ( \d + ) ? ( \d + ) ? / ;
@@ -46,7 +47,7 @@ Result.prototype.parseRow = function(rowData) {
46
47
var fieldType = field . dataTypeID ;
47
48
var parsedValue = null ;
48
49
if ( rawValue !== null ) {
49
- parsedValue = types . getTypeParser ( fieldType , field . format || 'text' ) ( rawValue ) ;
50
+ parsedValue = this . _parsers [ i ] ( rawValue ) ;
50
51
}
51
52
var fieldName = field . name ;
52
53
row [ fieldName ] = parsedValue ;
@@ -65,9 +66,12 @@ Result.prototype.addFields = function(fieldDescriptions) {
65
66
//you need to reset the fields
66
67
if ( this . fields . length ) {
67
68
this . fields = [ ] ;
69
+ this . _parsers = [ ] ;
68
70
}
69
71
for ( var i = 0 ; i < fieldDescriptions . length ; i ++ ) {
70
- this . fields . push ( fieldDescriptions [ i ] ) ;
72
+ var desc = fieldDescriptions [ i ] ;
73
+ this . fields . push ( desc ) ;
74
+ this . _parsers . push ( types . getTypeParser ( desc . dataTypeID , desc . format || 'text' ) ) ;
71
75
}
72
76
} ;
73
77
You can’t perform that action at this time.
0 commit comments