| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 if (value.IsEmpty()) | 118 if (value.IsEmpty()) |
| 119 return false; | 119 return false; |
| 120 return true; | 120 return true; |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool Dictionary::get(const String& key, v8::Local<v8::Value>& value) const | 123 bool Dictionary::get(const String& key, v8::Local<v8::Value>& value) const |
| 124 { | 124 { |
| 125 return getKey(key, value); | 125 return getKey(key, value); |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool Dictionary::getWithUndefinedOrNullCheck(const String& key, String& value) c
onst | |
| 129 { | |
| 130 v8::Local<v8::Value> v8Value; | |
| 131 if (!getKey(key, v8Value) || blink::isUndefinedOrNull(v8Value)) | |
| 132 return false; | |
| 133 | |
| 134 TOSTRING_DEFAULT(V8StringResource<>, stringValue, v8Value, false); | |
| 135 value = stringValue; | |
| 136 return true; | |
| 137 } | |
| 138 | |
| 139 bool Dictionary::getWithUndefinedOrNullCheck(const String& key, RefPtrWillBeMemb
er<Element>& value) const | |
| 140 { | |
| 141 v8::Local<v8::Value> v8Value; | |
| 142 if (!getKey(key, v8Value) || blink::isUndefinedOrNull(v8Value)) | |
| 143 return false; | |
| 144 | |
| 145 value = V8Element::toImplWithTypeCheck(m_isolate, v8Value); | |
| 146 return true; | |
| 147 } | |
| 148 | |
| 149 bool Dictionary::getWithUndefinedOrNullCheck(const String& key, RefPtrWillBeMemb
er<Path2D>& value) const | |
| 150 { | |
| 151 v8::Local<v8::Value> v8Value; | |
| 152 if (!getKey(key, v8Value) || blink::isUndefinedOrNull(v8Value)) | |
| 153 return false; | |
| 154 | |
| 155 value = V8Path2D::toImplWithTypeCheck(m_isolate, v8Value); | |
| 156 return true; | |
| 157 } | |
| 158 | |
| 159 bool Dictionary::get(const String& key, Dictionary& value) const | 128 bool Dictionary::get(const String& key, Dictionary& value) const |
| 160 { | 129 { |
| 161 v8::Local<v8::Value> v8Value; | 130 v8::Local<v8::Value> v8Value; |
| 162 if (!getKey(key, v8Value)) | 131 if (!getKey(key, v8Value)) |
| 163 return false; | 132 return false; |
| 164 | 133 |
| 165 if (v8Value->IsObject()) { | 134 if (v8Value->IsObject()) { |
| 166 ASSERT(m_isolate); | 135 ASSERT(m_isolate); |
| 167 ASSERT(m_isolate == v8::Isolate::GetCurrent()); | 136 ASSERT(m_isolate == v8::Isolate::GetCurrent()); |
| 168 value = Dictionary(v8Value, m_isolate); | 137 value = Dictionary(v8Value, m_isolate); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 251 |
| 283 return *this; | 252 return *this; |
| 284 } | 253 } |
| 285 | 254 |
| 286 void Dictionary::ConversionContext::throwTypeError(const String& detail) | 255 void Dictionary::ConversionContext::throwTypeError(const String& detail) |
| 287 { | 256 { |
| 288 exceptionState().throwTypeError(detail); | 257 exceptionState().throwTypeError(detail); |
| 289 } | 258 } |
| 290 | 259 |
| 291 } // namespace blink | 260 } // namespace blink |
| OLD | NEW |