| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/testing/DictionaryTest.h" | 5 #include "core/testing/DictionaryTest.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.h" |
| 8 #include "bindings/core/v8/V8ObjectBuilder.h" | 8 #include "bindings/core/v8/V8ObjectBuilder.h" |
| 9 #include "core/testing/InternalDictionary.h" | 9 #include "core/testing/InternalDictionary.h" |
| 10 #include "core/testing/InternalDictionaryDerived.h" | 10 #include "core/testing/InternalDictionaryDerived.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 | 167 |
| 168 String DictionaryTest::stringFromIterable( | 168 String DictionaryTest::stringFromIterable( |
| 169 ScriptState* scriptState, | 169 ScriptState* scriptState, |
| 170 Dictionary iterable, | 170 Dictionary iterable, |
| 171 ExceptionState& exceptionState) const { | 171 ExceptionState& exceptionState) const { |
| 172 StringBuilder result; | 172 StringBuilder result; |
| 173 ExecutionContext* executionContext = scriptState->getExecutionContext(); | 173 ExecutionContext* executionContext = scriptState->getExecutionContext(); |
| 174 DictionaryIterator iterator = iterable.getIterator(executionContext); | 174 DictionaryIterator iterator = iterable.getIterator(executionContext); |
| 175 if (iterator.isNull()) | 175 if (iterator.isNull()) |
| 176 return emptyString(); | 176 return emptyString; |
| 177 | 177 |
| 178 bool firstLoop = true; | 178 bool firstLoop = true; |
| 179 while (iterator.next(executionContext, exceptionState)) { | 179 while (iterator.next(executionContext, exceptionState)) { |
| 180 if (exceptionState.hadException()) | 180 if (exceptionState.hadException()) |
| 181 return emptyString(); | 181 return emptyString; |
| 182 | 182 |
| 183 if (firstLoop) | 183 if (firstLoop) |
| 184 firstLoop = false; | 184 firstLoop = false; |
| 185 else | 185 else |
| 186 result.append(','); | 186 result.append(','); |
| 187 | 187 |
| 188 v8::Local<v8::Value> value; | 188 v8::Local<v8::Value> value; |
| 189 if (v8Call(iterator.value(), value)) | 189 if (v8Call(iterator.value(), value)) |
| 190 result.append(toCoreString(value->ToString())); | 190 result.append(toCoreString(value->ToString())); |
| 191 } | 191 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 226 } |
| 227 | 227 |
| 228 DEFINE_TRACE(DictionaryTest) { | 228 DEFINE_TRACE(DictionaryTest) { |
| 229 visitor->trace(m_elementMember); | 229 visitor->trace(m_elementMember); |
| 230 visitor->trace(m_elementOrNullMember); | 230 visitor->trace(m_elementOrNullMember); |
| 231 visitor->trace(m_doubleOrStringSequenceMember); | 231 visitor->trace(m_doubleOrStringSequenceMember); |
| 232 visitor->trace(m_eventTargetOrNullMember); | 232 visitor->trace(m_eventTargetOrNullMember); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace blink | 235 } // namespace blink |
| OLD | NEW |