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

Unified Diff: extensions/renderer/api_signature.cc

Issue 2947223003: [Extensions Bindings] Consider argument type more in signature parsing (Closed)
Patch Set: . Created 3 years, 6 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: extensions/renderer/api_signature.cc
diff --git a/extensions/renderer/api_signature.cc b/extensions/renderer/api_signature.cc
index c07705fba852e7655269de065c96896698c5fc35..4340313bd497291b09f30ff30ec031e8987abff4 100644
--- a/extensions/renderer/api_signature.cc
+++ b/extensions/renderer/api_signature.cc
@@ -210,8 +210,7 @@ bool ArgumentParser::ParseArgument(const ArgumentSpec& spec) {
return true;
}
- if (!spec.ParseArgument(context_, value, type_refs_, GetBuffer(),
- &parse_error_)) {
+ if (!spec.IsCorrectType(value, type_refs_, &parse_error_)) {
if (!spec.optional()) {
*error_ = api_errors::ArgumentError(spec.name(), parse_error_);
return false;
@@ -221,6 +220,12 @@ bool ArgumentParser::ParseArgument(const ArgumentSpec& spec) {
return true;
}
+ if (!spec.ParseArgument(context_, value, type_refs_, GetBuffer(),
+ &parse_error_)) {
+ *error_ = api_errors::ArgumentError(spec.name(), parse_error_);
+ return false;
+ }
+
ConsumeArgument();
AddParsedArgument(value);
return true;

Powered by Google App Engine
This is Rietveld 408576698