Currently, functions with unknown names or with an incorrect number of arguments are silently replaced with true(). This is very confusing - I've been fooled by this several times already when making layout tests to other bugs. Firefox and Opera do raise exceptions here, so I think we should fix this before shipping XPathEvaluator.
Created attachment 13689 [details] proposed patch In Firefox, createExpression doesn't raise an exception if the number of arguments is wrong,but it does for unknown function names (evaluating the expression does cause an exception to be raised, of course). Since expressions are created to be evaluated, this difference doesn't look like a serious issue to me.
Comment on attachment 13689 [details] proposed patch r=me
Committed revision 20338.