| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 return has_key; | 73 return has_key; |
| 74 } | 74 } |
| 75 | 75 |
| 76 DictionaryIterator Dictionary::GetIterator( | 76 DictionaryIterator Dictionary::GetIterator( |
| 77 ExecutionContext* execution_context) const { | 77 ExecutionContext* execution_context) const { |
| 78 v8::Local<v8::Value> iterator_getter; | 78 v8::Local<v8::Value> iterator_getter; |
| 79 if (!GetInternal(v8::Symbol::GetIterator(isolate_), iterator_getter) || | 79 if (!GetInternal(v8::Symbol::GetIterator(isolate_), iterator_getter) || |
| 80 !iterator_getter->IsFunction()) | 80 !iterator_getter->IsFunction()) |
| 81 return nullptr; | 81 return nullptr; |
| 82 v8::Local<v8::Value> iterator; | 82 v8::Local<v8::Value> iterator; |
| 83 if (!V8Call(V8ScriptRunner::CallFunction( | 83 if (!V8ScriptRunner::CallFunction( |
| 84 v8::Local<v8::Function>::Cast(iterator_getter), | 84 v8::Local<v8::Function>::Cast(iterator_getter), execution_context, |
| 85 execution_context, dictionary_object_, 0, nullptr, isolate_), | 85 dictionary_object_, 0, nullptr, isolate_) |
| 86 iterator)) | 86 .ToLocal(&iterator)) |
| 87 return nullptr; | 87 return nullptr; |
| 88 if (!iterator->IsObject()) | 88 if (!iterator->IsObject()) |
| 89 return nullptr; | 89 return nullptr; |
| 90 return DictionaryIterator(v8::Local<v8::Object>::Cast(iterator), isolate_); | 90 return DictionaryIterator(v8::Local<v8::Object>::Cast(iterator), isolate_); |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool Dictionary::Get(const StringView& key, Dictionary& value) const { | 93 bool Dictionary::Get(const StringView& key, Dictionary& value) const { |
| 94 v8::Local<v8::Value> v8_value; | 94 v8::Local<v8::Value> v8_value; |
| 95 if (!Get(key, v8_value)) | 95 if (!Get(key, v8_value)) |
| 96 return false; | 96 return false; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 if (!string_key.Prepare(GetIsolate(), exception_state)) | 196 if (!string_key.Prepare(GetIsolate(), exception_state)) |
| 197 return Vector<String>(); | 197 return Vector<String>(); |
| 198 | 198 |
| 199 names.push_back(string_key); | 199 names.push_back(string_key); |
| 200 } | 200 } |
| 201 | 201 |
| 202 return names; | 202 return names; |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace blink | 205 } // namespace blink |
| OLD | NEW |