@@ 7716-7731 (lines=16) @@ | ||
7713 | } |
|
7714 | ||
7715 | // Check to see if we have a response for the expected dataType |
|
7716 | if ( dataTypes[ 0 ] in responses ) { |
|
7717 | finalDataType = dataTypes[ 0 ]; |
|
7718 | } else { |
|
7719 | // Try convertible dataTypes |
|
7720 | for ( type in responses ) { |
|
7721 | if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { |
|
7722 | finalDataType = type; |
|
7723 | break; |
|
7724 | } |
|
7725 | if ( !firstDataType ) { |
|
7726 | firstDataType = type; |
|
7727 | } |
|
7728 | } |
|
7729 | // Or just use first one |
|
7730 | finalDataType = finalDataType || firstDataType; |
|
7731 | } |
|
7732 | ||
7733 | // If we found a dataType |
|
7734 | // We add the dataType to the list if needed |
@@ 6788-6803 (lines=16) @@ | ||
6785 | } |
|
6786 | ||
6787 | // Check to see if we have a response for the expected dataType |
|
6788 | if ( dataTypes[ 0 ] in responses ) { |
|
6789 | finalDataType = dataTypes[ 0 ]; |
|
6790 | } else { |
|
6791 | // Try convertible dataTypes |
|
6792 | for ( type in responses ) { |
|
6793 | if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { |
|
6794 | finalDataType = type; |
|
6795 | break; |
|
6796 | } |
|
6797 | if ( !firstDataType ) { |
|
6798 | firstDataType = type; |
|
6799 | } |
|
6800 | } |
|
6801 | // Or just use first one |
|
6802 | finalDataType = finalDataType || firstDataType; |
|
6803 | } |
|
6804 | ||
6805 | // If we found a dataType |
|
6806 | // We add the dataType to the list if needed |