Make relational comparisons between NodeSets and booleans follow the spec.

b=116540 r=Pike sr=jst
This commit is contained in:
sicking%bigfoot.com 2005-11-02 07:37:32 +00:00
Родитель a3d8775cc7
Коммит b6054b4a2d
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -58,6 +58,9 @@ MBool RelationalExpr::compareResults(ExprResult* left, ExprResult* right) {
//-- handle case for just Left NodeSet or Both NodeSets //-- handle case for just Left NodeSet or Both NodeSets
if (ltype == ExprResult::NODESET) { if (ltype == ExprResult::NODESET) {
if (rtype == ExprResult::BOOLEAN)
return compareResults(&BooleanResult(left->booleanValue()), right);
NodeSet* nodeSet = (NodeSet*)left; NodeSet* nodeSet = (NodeSet*)left;
for ( int i = 0; i < nodeSet->size(); i++) { for ( int i = 0; i < nodeSet->size(); i++) {
String str; String str;
@ -70,6 +73,9 @@ MBool RelationalExpr::compareResults(ExprResult* left, ExprResult* right) {
} }
//-- handle case for Just Right NodeSet //-- handle case for Just Right NodeSet
else if ( rtype == ExprResult::NODESET) { else if ( rtype == ExprResult::NODESET) {
if (ltype == ExprResult::BOOLEAN)
return compareResults(left, &BooleanResult(right->booleanValue()));
NodeSet* nodeSet = (NodeSet*)right; NodeSet* nodeSet = (NodeSet*)right;
for ( int i = 0; i < nodeSet->size(); i++) { for ( int i = 0; i < nodeSet->size(); i++) {
String str; String str;