Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Unified Diff: Source/bindings/core/v8/Dictionary.h

Issue 554893004: IDL: Add more test cases to idl-dictionary-unittest.html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/core/v8/Dictionary.h
diff --git a/Source/bindings/core/v8/Dictionary.h b/Source/bindings/core/v8/Dictionary.h
index 573932f2c83d587d339bb7e0409fb94809438061..bfa26dcd0b50ee4015edc9d90614a62c1c4a6e8a 100644
--- a/Source/bindings/core/v8/Dictionary.h
+++ b/Source/bindings/core/v8/Dictionary.h
@@ -134,9 +134,9 @@ public:
v8::Isolate* isolate() const { return m_isolate; }
-private:
bool getKey(const String& key, v8::Local<v8::Value>&) const;
+private:
v8::Handle<v8::Value> m_options;
v8::Isolate* m_isolate;
};
@@ -156,6 +156,14 @@ struct DictionaryHelper {
static bool get(const Dictionary&, const String& key, T& value);
template <typename T>
static bool get(const Dictionary&, const String& key, T& value, bool& hasValue);
+ template <typename T>
+ static bool getWithUndefinedOrNullCheck(const Dictionary& dictionary, const String& key, T& value)
+ {
+ v8::Local<v8::Value> v8Value;
+ if (!dictionary.getKey(key, v8Value) || isUndefinedOrNull(v8Value))
+ return false;
+ return DictionaryHelper::get(dictionary, key, value);
+ }
template <template <typename> class PointerType, typename T>
static bool get(const Dictionary&, const String& key, PointerType<T>& value);
template <typename T>
« no previous file with comments | « LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt ('k') | Source/bindings/core/v8/DictionaryHelperForCore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698