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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 static bool get(const Dictionary&, | 126 static bool get(const Dictionary&, |
127 const StringView& key, | 127 const StringView& key, |
128 T& value, | 128 T& value, |
129 bool& hasValue); | 129 bool& hasValue); |
130 template <typename T> | 130 template <typename T> |
131 static bool get(const Dictionary&, | 131 static bool get(const Dictionary&, |
132 const StringView& key, | 132 const StringView& key, |
133 T& value, | 133 T& value, |
134 ExceptionState&); | 134 ExceptionState&); |
135 template <typename T> | 135 template <typename T> |
136 static bool getWithUndefinedOrNullCheck(const Dictionary& dictionary, | 136 static bool getWithUndefinedCheck(const Dictionary& dictionary, |
137 const StringView& key, | 137 const StringView& key, |
138 T& value) { | 138 T& value) { |
139 v8::Local<v8::Value> v8Value; | 139 v8::Local<v8::Value> v8Value; |
140 if (!dictionary.get(key, v8Value) || isUndefinedOrNull(v8Value)) | 140 if (!dictionary.get(key, v8Value) || v8Value.IsEmpty() || |
| 141 v8Value->IsUndefined()) |
141 return false; | 142 return false; |
142 return DictionaryHelper::get(dictionary, key, value); | 143 return DictionaryHelper::get(dictionary, key, value); |
143 } | 144 } |
144 template <template <typename> class PointerType, typename T> | 145 template <template <typename> class PointerType, typename T> |
145 static bool get(const Dictionary&, | 146 static bool get(const Dictionary&, |
146 const StringView& key, | 147 const StringView& key, |
147 PointerType<T>& value); | 148 PointerType<T>& value); |
148 template <typename T> | 149 template <typename T> |
149 static bool get(const Dictionary&, const StringView& key, Nullable<T>& value); | 150 static bool get(const Dictionary&, const StringView& key, Nullable<T>& value); |
150 }; | 151 }; |
151 | 152 |
152 } // namespace blink | 153 } // namespace blink |
153 | 154 |
154 #endif // Dictionary_h | 155 #endif // Dictionary_h |
OLD | NEW |