diff options
author | bob <bcz@cs.brown.edu> | 2019-07-19 14:43:26 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-07-19 14:43:26 -0400 |
commit | 89b2500e71e4d167c7ae179c3eb2b5052b128ad0 (patch) | |
tree | 8b243d52a47024b06d9941134d56c4e25f80d930 /src/new_fields/Doc.ts | |
parent | ae07ba8fb410752ea98702219247ce5f89d1758b (diff) | |
parent | 8854d3277541a67aef4187b5d3592bea5a7fcfa2 (diff) |
Merge branch 'master' into stackingSections
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 152a48e5f..c6b364d8e 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -10,16 +10,16 @@ import { RefField, FieldId } from "./RefField"; import { ToScriptString, SelfProxy, Parent, OnUpdate, Self, HandleUpdate, Update, Id } from "./FieldSymbols"; import { scriptingGlobal } from "../client/util/Scripting"; import { List } from "./List"; -import { string } from "prop-types"; import { DocumentType } from "../client/documents/Documents"; +import { ComputedField } from "./ScriptField"; export namespace Field { export function toKeyValueString(doc: Doc, key: string): string { const onDelegate = Object.keys(doc).includes(key); - let field = FieldValue(doc[key]); + let field = ComputedField.WithoutComputed(() => FieldValue(doc[key])); if (Field.IsField(field)) { - return (onDelegate ? "=" : "") + Field.toScriptString(field); + return (onDelegate ? "=" : "") + (field instanceof ComputedField ? `:=${field.script.originalScript}` : Field.toScriptString(field)); } return ""; } |