aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-05-16 16:09:06 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-05-16 16:09:06 -0400
commit179200777d8d283509bc81ea1318c1f51c2251ce (patch)
tree27855751b8ad11a80c33a2ce3e737ad11a69a9fd /src/new_fields
parentc96e61de2cea0fee1f6c80caf426535dbdc3d37c (diff)
parent171f285b5e61d7a0591578f1499f81b779a3c340 (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
Diffstat (limited to 'src/new_fields')
-rw-r--r--src/new_fields/Doc.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index 2ae816da4..de72be3ea 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -140,7 +140,7 @@ export namespace Doc {
return Cast(Get(doc, key, ignoreProto), ctor) as FieldResult<T>;
}
export async function SetOnPrototype(doc: Doc, key: string, value: Field) {
- const proto = Object.getOwnPropertyNames(doc).indexOf("isPrototype") == -1 ? doc.proto : doc;
+ const proto = Object.getOwnPropertyNames(doc).indexOf("isPrototype") === -1 ? doc.proto : doc;
if (proto) {
proto[key] = value;
@@ -178,9 +178,10 @@ export namespace Doc {
}
export function MakeAlias(doc: Doc) {
+ const proto = Object.getOwnPropertyNames(doc).indexOf("isPrototype") === -1 ? doc.proto : undefined;
const alias = new Doc;
- if (!doc.proto) {
+ if (!proto) {
alias.proto = doc;
} else {
PromiseValue(Cast(doc.proto, Doc)).then(proto => {