diff options
| author | loudonclear <loudon_cohen@brown.edu> | 2019-06-14 14:36:41 -0400 |
|---|---|---|
| committer | loudonclear <loudon_cohen@brown.edu> | 2019-06-14 14:36:41 -0400 |
| commit | 84ee857c73715c44258313b1481358db03a33b32 (patch) | |
| tree | 29db2c072212092d37f350024b93c42b1ec5e7d8 /src/new_fields | |
| parent | 35786bfec967b2a9f1abc570bffe73530c053207 (diff) | |
| parent | 618d3717e118f978de976cb34e8bc2051c726ffc (diff) | |
pull from master
Diffstat (limited to 'src/new_fields')
| -rw-r--r-- | src/new_fields/Doc.ts | 3 | ||||
| -rw-r--r-- | src/new_fields/util.ts | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 7e02a5bc5..c2cfda079 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -186,7 +186,8 @@ export namespace Doc { } // compare whether documents or their protos match - export function AreProtosEqual(doc: Doc, other: Doc) { + export function AreProtosEqual(doc?: Doc, other?: Doc) { + if (!doc || !other) return false; let r = (doc === other); let r2 = (doc.proto === other); let r3 = (other.proto === doc); diff --git a/src/new_fields/util.ts b/src/new_fields/util.ts index fe0da2e7a..8cb1db953 100644 --- a/src/new_fields/util.ts +++ b/src/new_fields/util.ts @@ -6,7 +6,7 @@ import { FieldValue } from "./Types"; import { RefField } from "./RefField"; import { ObjectField } from "./ObjectField"; import { action } from "mobx"; -import { Parent, OnUpdate, Update, Id } from "./FieldSymbols"; +import { Parent, OnUpdate, Update, Id, SelfProxy } from "./FieldSymbols"; import { ComputedField } from "../fields/ScriptField"; export const setter = action(function (target: any, prop: string | symbol | number, value: any, receiver: any): boolean { @@ -86,7 +86,7 @@ export function deleteProperty(target: any, prop: string | number | symbol) { delete target[prop]; return true; } - target[prop] = undefined; + target[SelfProxy][prop] = undefined; return true; } |
