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

Unified Diff: tools/json_schema_compiler/cc_generator.py

Issue 1128523003: Add support for passing errors through PopulateArrayFromList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated JSON schema tests. Created 5 years, 7 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 | « no previous file | tools/json_schema_compiler/test/error_generation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cc_generator.py
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 6faac39751815d5910326658b21d4bb6583fde5a..4fa55be1e2bb49824e02745cc982cdcb2e218326 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -778,10 +778,9 @@ class _Generator(object):
failure_value,
is_ptr=is_ptr))
else:
- c.Sblock('if (!%s) {' % self._util_cc_helper.PopulateArrayFromList(
- 'list',
- dst_var,
- is_ptr))
+ c.Sblock('if (!%s(%s)) {' % (
+ self._util_cc_helper.PopulateArrayFromListFunction(is_ptr),
+ self._GenerateArgs(('*list', '&%(dst_var)s'))))
c.Concat(self._GenerateError(
'"unable to populate array \'%%(parent_key)s\'"'))
if is_ptr and self._generate_error_messages:
« no previous file with comments | « no previous file | tools/json_schema_compiler/test/error_generation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698