diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bg/js/json-schema.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/bg/js/json-schema.js b/ext/bg/js/json-schema.js index ab4a4817..7a7f2489 100644 --- a/ext/bg/js/json-schema.js +++ b/ext/bg/js/json-schema.js @@ -138,7 +138,13 @@ class JsonSchemaProxyHandler { } const additionalProperties = schema.additionalProperties; - return JsonSchemaProxyHandler.isObject(additionalProperties) ? additionalProperties : null; + if (additionalProperties === false) { + return null; + } if (JsonSchemaProxyHandler.isObject(additionalProperties)) { + return additionalProperties; + } else { + return JsonSchemaProxyHandler._unconstrainedSchema; + } } case 'array': { @@ -491,6 +497,8 @@ class JsonSchemaProxyHandler { } } +JsonSchemaProxyHandler._unconstrainedSchema = {}; + class JsonSchema { static createProxy(target, schema) { return new Proxy(target, new JsonSchemaProxyHandler(schema)); |