diff options
author | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 19:58:38 +0000 |
---|---|---|
committer | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 19:58:38 +0000 |
commit | 5276c66be140d1f63f2ca94f72c697aba156a33d (patch) | |
tree | bf73f4ebab3ae249e8066d950917f0be4d5a4844 /tools/json_schema_compiler/idl_schema.py | |
parent | 9678bc33c3feec0cf0cdcc5931cfb49a17500190 (diff) | |
download | chromium_src-5276c66be140d1f63f2ca94f72c697aba156a33d.zip chromium_src-5276c66be140d1f63f2ca94f72c697aba156a33d.tar.gz chromium_src-5276c66be140d1f63f2ca94f72c697aba156a33d.tar.bz2 |
Fix IDL schema compiler to properly handle optional arguments
BUG=122224
TEST=Included unit test should compile and run.
Review URL: http://codereview.chromium.org/10032001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131415 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler/idl_schema.py')
-rw-r--r-- | tools/json_schema_compiler/idl_schema.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py index ece0832..9779e27 100644 --- a/tools/json_schema_compiler/idl_schema.py +++ b/tools/json_schema_compiler/idl_schema.py @@ -108,6 +108,10 @@ class Typeref(object): def process(self, refs): properties = self.additional_properties + + if self.parent.GetProperty('OPTIONAL', False): + properties['optional'] = True + if self.typeref == 'DOMString': properties['type'] = 'string' elif self.typeref == 'boolean': |