summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-03 11:55:39 -0400
committerGitHub <noreply@github.com>2020-07-03 11:55:39 -0400
commit1d02013642df825f3539b03c325dc51d9fd00e83 (patch)
treedea296971531ccee8e617c8a8940b75ebffcec36 /ext
parent0279d002741d22cacacb9f15897aebf1f953908c (diff)
Make JsonSchemaProxyHandler.unconstrainedSchema public and non-configurable (#636)
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/json-schema.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/bg/js/json-schema.js b/ext/bg/js/json-schema.js
index 2e009a7a..84b27af5 100644
--- a/ext/bg/js/json-schema.js
+++ b/ext/bg/js/json-schema.js
@@ -139,7 +139,7 @@ class JsonSchemaProxyHandler {
if (path !== null) { path.push(['additionalProperties', additionalProperties]); }
return additionalProperties;
} else {
- const result = JsonSchemaProxyHandler._unconstrainedSchema;
+ const result = JsonSchemaProxyHandler.unconstrainedSchema;
if (path !== null) { path.push([null, result]); }
return result;
}
@@ -167,7 +167,7 @@ class JsonSchemaProxyHandler {
if (path !== null) { path.push(['additionalItems', additionalItems]); }
return additionalItems;
} else {
- const result = JsonSchemaProxyHandler._unconstrainedSchema;
+ const result = JsonSchemaProxyHandler.unconstrainedSchema;
if (path !== null) { path.push([null, result]); }
return result;
}
@@ -579,7 +579,12 @@ class JsonSchemaProxyHandler {
}
}
-JsonSchemaProxyHandler._unconstrainedSchema = {};
+Object.defineProperty(JsonSchemaProxyHandler, 'unconstrainedSchema', {
+ value: Object.freeze({}),
+ configurable: false,
+ enumerable: true,
+ writable: false
+});
class JsonSchemaTraversalInfo {
constructor(value, schema) {