Commit 5107b8b2 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions] Fix a check in the JSON Schema Compiler

There was an unnecessary check and graceful handling in the
JSON Schema Compiler that should never have been hit. Replace it with
an assert.

Bug: None

Change-Id: I5cfab6de46f042233ad66f98215e6737e3492afd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764103
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690097}
parent e30383d5
......@@ -320,13 +320,11 @@ class Function(object):
callback_param = None
params = json.get('parameters', [])
for i, param in enumerate(params):
if param.get('type') == 'function' and i == len(params) - 1:
if callback_param:
# No ParseException because the webstore has this.
# Instead, pretend all intermediate callbacks are properties.
self.params.append(GeneratePropertyFromParam(callback_param))
if i == len(params) - 1 and param.get('type') == 'function':
callback_param = param
else:
# Treat all intermediate function arguments as properties. Certain APIs,
# such as the webstore, have these.
self.params.append(GeneratePropertyFromParam(param))
if callback_param:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment