OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright 2005 Frerich Raabe <raabe@kde.org> |
3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 22 matching lines...) Expand all Loading... |
33 namespace XPath { | 33 namespace XPath { |
34 | 34 |
35 VariableReference::VariableReference(const String& name) | 35 VariableReference::VariableReference(const String& name) |
36 : m_name(name) | 36 : m_name(name) |
37 { | 37 { |
38 } | 38 } |
39 | 39 |
40 Value VariableReference::evaluate() const | 40 Value VariableReference::evaluate() const |
41 { | 41 { |
42 HashMap<String, String>& bindings = evaluationContext().variableBindings; | 42 HashMap<String, String>& bindings = evaluationContext().variableBindings; |
43 if (!bindings.contains(m_name)) | 43 if (!bindings.contains(m_name)) { |
44 // FIXME: Is this the right thing to do if an unknown variable is refere
nced? | 44 // FIXME: Is this the right thing to do if an unknown variable is |
| 45 // referenced? |
45 return ""; | 46 return ""; |
| 47 } |
46 return bindings.get(m_name); | 48 return bindings.get(m_name); |
47 } | 49 } |
48 | 50 |
49 } | 51 } |
50 } | 52 } |
OLD | NEW |