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

Unified Diff: Source/bindings/v8/Dictionary.cpp

Issue 23361019: WebCrypto: properly normalize optional numeric parameters. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Replace contains() with a different get() method Created 7 years, 4 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
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/modules/crypto/NormalizeAlgorithm.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/Dictionary.cpp
diff --git a/Source/bindings/v8/Dictionary.cpp b/Source/bindings/v8/Dictionary.cpp
index 199197bca029d90b9e2a7c49847e237a1026d3a8..6b29255755998d90c5cfa72516566cd6fe871f3e 100644
--- a/Source/bindings/v8/Dictionary.cpp
+++ b/Source/bindings/v8/Dictionary.cpp
@@ -142,12 +142,15 @@ bool Dictionary::get(const String& key, int32_t& value) const
return true;
}
-bool Dictionary::get(const String& key, double& value) const
+bool Dictionary::get(const String& key, double& value, bool& hasValue) const
{
v8::Local<v8::Value> v8Value;
- if (!getKey(key, v8Value))
+ if (!getKey(key, v8Value)) {
+ hasValue = false;
return false;
+ }
+ hasValue = true;
v8::Local<v8::Number> v8Number = v8Value->ToNumber();
if (v8Number.IsEmpty())
return false;
@@ -155,6 +158,12 @@ bool Dictionary::get(const String& key, double& value) const
return true;
}
+bool Dictionary::get(const String& key, double& value) const
+{
+ bool unused;
+ return get(key, value, unused);
+}
+
bool Dictionary::get(const String& key, String& value) const
{
v8::Local<v8::Value> v8Value;
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/modules/crypto/NormalizeAlgorithm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698