Chromium Code Reviews| Index: tools/json_schema_compiler/js_util.py |
| diff --git a/tools/json_schema_compiler/js_util.py b/tools/json_schema_compiler/js_util.py |
| index 2549aefa2fae4966eee2c0f1fe4fef67667b82a7..60c52626c316bc3410b17b6818b48c377c35f052 100644 |
| --- a/tools/json_schema_compiler/js_util.py |
| +++ b/tools/json_schema_compiler/js_util.py |
| @@ -101,6 +101,18 @@ class JsUtil(object): |
| c.Eblock(' */') |
| + def AppendTypeJsDoc(self, c, namespace_name, js_type, nullable): |
| + """Appends the documentation for a type as a Code. |
| + """ |
| + c.Append('@type {') |
| + js_type_str = self._TypeToJsType(namespace_name, js_type).Render() |
| + if nullable: |
| + if js_type_str[0] == '!': |
| + js_type_str = js_type_str[1:] |
| + js_type_str = '?' + js_type_str |
|
Devlin
2017/01/12 17:28:48
Note: This means the possible values for the type
dmazzoni
2017/01/13 21:22:54
You're totally right.
Pretty much everything retu
|
| + c.Append(js_type_str, new_line=False) |
| + c.Append('}', new_line=False) |
| + |
| def _FunctionToJsFunction(self, namespace_name, function): |
| """Converts a model.Function to a JS type (i.e., function([params])...)""" |
| c = Code() |