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

Unified Diff: tools/json_schema_compiler/js_externs_generator.py

Issue 2854183005: js_externs_generator: Treat empty object as Object
Patch Set: Created 3 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/js_externs_generator.py
diff --git a/tools/json_schema_compiler/js_externs_generator.py b/tools/json_schema_compiler/js_externs_generator.py
index a5ef075ac260f574782cf4d06f974e3e662c0e79..f8d697125b766a74ca47efaff90fb674e5ea92d7 100644
--- a/tools/json_schema_compiler/js_externs_generator.py
+++ b/tools/json_schema_compiler/js_externs_generator.py
@@ -151,11 +151,14 @@ class _Generator(object):
def _AppendTypedef(self, c, properties):
"""Given an OrderedDict of properties, Appends code containing a @typedef.
"""
- if not properties: return
-
c.Append('@typedef {')
- self._js_util.AppendObjectDefinition(c, self._namespace.name, properties,
- new_line=False)
+
+ if properties:
+ self._js_util.AppendObjectDefinition(c, self._namespace.name, properties,
+ new_line=False)
+ else:
+ c.Append('Object', new_line=False)
+
c.Append('}', new_line=False)
def _AppendFunction(self, c, function):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698