| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 { | 47 { |
| 48 visitor->trace(m_data); | 48 visitor->trace(m_data); |
| 49 } | 49 } |
| 50 | 50 |
| 51 const NodeSet& Value::toNodeSet(EvaluationContext* context) const | 51 const NodeSet& Value::toNodeSet(EvaluationContext* context) const |
| 52 { | 52 { |
| 53 if (!isNodeSet() && context) | 53 if (!isNodeSet() && context) |
| 54 context->hadTypeConversionError = true; | 54 context->hadTypeConversionError = true; |
| 55 | 55 |
| 56 if (!m_data) { | 56 if (!m_data) { |
| 57 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<NodeSet>, emptyNodeSet, (Node
Set::create())); | 57 DEFINE_STATIC_LOCAL(Persistent<NodeSet>, emptyNodeSet, (NodeSet::create(
))); |
| 58 return *emptyNodeSet; | 58 return *emptyNodeSet; |
| 59 } | 59 } |
| 60 | 60 |
| 61 return m_data->nodeSet(); | 61 return m_data->nodeSet(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 NodeSet& Value::modifiableNodeSet(EvaluationContext& context) | 64 NodeSet& Value::modifiableNodeSet(EvaluationContext& context) |
| 65 { | 65 { |
| 66 if (!isNodeSet()) | 66 if (!isNodeSet()) |
| 67 context.hadTypeConversionError = true; | 67 context.hadTypeConversionError = true; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return String::number(m_number); | 140 return String::number(m_number); |
| 141 case BooleanValue: | 141 case BooleanValue: |
| 142 return m_bool ? "true" : "false"; | 142 return m_bool ? "true" : "false"; |
| 143 } | 143 } |
| 144 ASSERT_NOT_REACHED(); | 144 ASSERT_NOT_REACHED(); |
| 145 return String(); | 145 return String(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } | 148 } |
| 149 } | 149 } |
| OLD | NEW |