diff options
author | Sam Wilkins <samuel_wilkins@brown.edu> | 2019-06-26 23:19:32 -0400 |
---|---|---|
committer | Sam Wilkins <samuel_wilkins@brown.edu> | 2019-06-26 23:19:32 -0400 |
commit | 4d16af0870f183b24b83e7b5c9a25b53796a23af (patch) | |
tree | eecf82cd7c7b39aac609c0d890d913756473d0f1 /src/new_fields/Doc.ts | |
parent | 18b568ce20b66c4e16521c043df804279a5cd163 (diff) | |
parent | 9178f360cbc3de7d836387a38e4e1ce6b7c77710 (diff) |
Merge branch 'templatesMac' of https://github.com/browngraphicslab/Dash-Web into templatesMac
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index ddbbc1436..bf98c2e6c 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -8,6 +8,8 @@ import { listSpec } from "./Schema"; import { ObjectField } from "./ObjectField"; import { RefField, FieldId } from "./RefField"; import { ToScriptString, SelfProxy, Parent, OnUpdate, Self, HandleUpdate, Update, Id } from "./FieldSymbols"; +import { LinkManager } from "../client/util/LinkManager"; +import { DocUtils } from "../client/documents/Documents"; export namespace Field { export function toScriptString(field: Field): string { @@ -179,9 +181,9 @@ export namespace Doc { let hasProto = doc.proto instanceof Doc; let onDeleg = Object.getOwnPropertyNames(doc).indexOf(key) !== -1; let onProto = hasProto && Object.getOwnPropertyNames(doc.proto).indexOf(key) !== -1; - if (onDeleg || !hasProto || (!onProto && !defaultProto)) + if (onDeleg || !hasProto || (!onProto && !defaultProto)) { doc[key] = value; - else doc.proto![key] = value; + } else doc.proto![key] = value; } export async function SetOnPrototype(doc: Doc, key: string, value: Field) { const proto = Object.getOwnPropertyNames(doc).indexOf("isPrototype") === -1 ? doc.proto : doc; @@ -298,6 +300,7 @@ export namespace Doc { } } }); + return copy; } |