/src/mozilla-central/dom/xslt/xpath/txErrorExpr.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
3 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | | |
6 | | #include "nsError.h" |
7 | | #include "txExpr.h" |
8 | | #include "nsString.h" |
9 | | #include "txIXPathContext.h" |
10 | | |
11 | | nsresult |
12 | | txErrorExpr::evaluate(txIEvalContext* aContext, txAExprResult** aResult) |
13 | 0 | { |
14 | 0 | *aResult = nullptr; |
15 | 0 |
|
16 | 0 | nsAutoString err(NS_LITERAL_STRING("Invalid expression evaluated")); |
17 | | #ifdef TX_TO_STRING |
18 | | err.AppendLiteral(": "); |
19 | | toString(err); |
20 | | #endif |
21 | | aContext->receiveError(err, |
22 | 0 | NS_ERROR_XPATH_INVALID_EXPRESSION_EVALUATED); |
23 | 0 |
|
24 | 0 | return NS_ERROR_XPATH_INVALID_EXPRESSION_EVALUATED; |
25 | 0 | } |
26 | | |
27 | | TX_IMPL_EXPR_STUBS_0(txErrorExpr, ANY_RESULT) |
28 | | |
29 | | bool |
30 | | txErrorExpr::isSensitiveTo(ContextSensitivity aContext) |
31 | 0 | { |
32 | 0 | // It doesn't really matter what we return here, but it might |
33 | 0 | // be a good idea to try to keep this as unoptimizable as possible |
34 | 0 | return true; |
35 | 0 | } |
36 | | |
37 | | #ifdef TX_TO_STRING |
38 | | void |
39 | | txErrorExpr::toString(nsAString& aStr) |
40 | | { |
41 | | aStr.Append(mStr); |
42 | | } |
43 | | #endif |