| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 DEFINE_TRACE(Value) { | 44 DEFINE_TRACE(Value) { |
| 45 visitor->trace(m_data); | 45 visitor->trace(m_data); |
| 46 } | 46 } |
| 47 | 47 |
| 48 const NodeSet& Value::toNodeSet(EvaluationContext* context) const { | 48 const NodeSet& Value::toNodeSet(EvaluationContext* context) const { |
| 49 if (!isNodeSet() && context) | 49 if (!isNodeSet() && context) |
| 50 context->hadTypeConversionError = true; | 50 context->hadTypeConversionError = true; |
| 51 | 51 |
| 52 if (!m_data) { | 52 if (!m_data) { |
| 53 ALLOW_UNSAFE_SINGLETON() |
| 53 DEFINE_STATIC_LOCAL(NodeSet, emptyNodeSet, (NodeSet::create())); | 54 DEFINE_STATIC_LOCAL(NodeSet, emptyNodeSet, (NodeSet::create())); |
| 54 return emptyNodeSet; | 55 return emptyNodeSet; |
| 55 } | 56 } |
| 56 | 57 |
| 57 return m_data->nodeSet(); | 58 return m_data->nodeSet(); |
| 58 } | 59 } |
| 59 | 60 |
| 60 NodeSet& Value::modifiableNodeSet(EvaluationContext& context) { | 61 NodeSet& Value::modifiableNodeSet(EvaluationContext& context) { |
| 61 if (!isNodeSet()) | 62 if (!isNodeSet()) |
| 62 context.hadTypeConversionError = true; | 63 context.hadTypeConversionError = true; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 return String::number(m_number); | 133 return String::number(m_number); |
| 133 case BooleanValue: | 134 case BooleanValue: |
| 134 return m_bool ? "true" : "false"; | 135 return m_bool ? "true" : "false"; |
| 135 } | 136 } |
| 136 NOTREACHED(); | 137 NOTREACHED(); |
| 137 return String(); | 138 return String(); |
| 138 } | 139 } |
| 139 | 140 |
| 140 } // namespace XPath | 141 } // namespace XPath |
| 141 } // namespace blink | 142 } // namespace blink |
| OLD | NEW |