aboutsummaryrefslogtreecommitdiff
path: root/src/fields/util.ts
diff options
context:
space:
mode:
authorgeireann <60007097+geireann@users.noreply.github.com>2020-06-30 03:29:27 +0800
committergeireann <60007097+geireann@users.noreply.github.com>2020-06-30 03:29:27 +0800
commit73bbc602fb964c82999faccfdde8eeca6fbf08c4 (patch)
tree576b41e77fd3280ee282e3ece6effbca39f57901 /src/fields/util.ts
parent6b75f84565a5019175b16ee5ea69fc5330aa2c0d (diff)
parentcb8b5b3d9e735c88b9efdd9b4a444cac40fdedb2 (diff)
Merge branch 'master' into mobile_revision_direct
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r--src/fields/util.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts
index ad7b6ea7a..2869ebed1 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -10,6 +10,7 @@ import { DocServer } from "../client/DocServer";
import { ComputedField } from "./ScriptField";
import { ScriptCast } from "./Types";
+
function _readOnlySetter(): never {
throw new Error("Documents can't be modified in read-only mode");
}
@@ -107,10 +108,10 @@ export function OVERRIDE_ACL(val: boolean) {
}
const layoutProps = ["panX", "panY", "width", "height", "nativeWidth", "nativeHeight", "fitWidth", "fitToBox",
- "LODdisable", "chromeStatus", "viewType", "gridGap", "xMargin", "yMargin", "autoHeight"];
+ "chromeStatus", "viewType", "gridGap", "xMargin", "yMargin", "autoHeight"];
export function setter(target: any, in_prop: string | symbol | number, value: any, receiver: any): boolean {
let prop = in_prop;
- if (target[AclSym] && !_overrideAcl) return true;
+ if (target[AclSym] && !_overrideAcl && !DocServer.PlaygroundFields.includes(in_prop.toString())) return true;
if (typeof prop === "string" && prop !== "__id" && prop !== "__fields" && (prop.startsWith("_") || layoutProps.includes(prop))) {
if (!prop.startsWith("_")) {
console.log(prop + " is deprecated - switch to _" + prop);
@@ -155,9 +156,6 @@ export function getter(target: any, in_prop: string | symbol | number, receiver:
function getFieldImpl(target: any, prop: string | number, receiver: any, ignoreProto: boolean = false): any {
receiver = receiver || target[SelfProxy];
- if (target === undefined) {
- console.log("");
- }
let field = target.__fields[prop];
for (const plugin of getterPlugins) {
const res = plugin(receiver, prop, field);