diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-05-18 10:50:28 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-05-18 10:50:28 -0400 |
commit | 3fd191a2d031e1a186a4eb2e009887399a4bc347 (patch) | |
tree | a98f057e981f9d5dcb6c5e31cba8779668457d54 /src/new_fields/Doc.ts | |
parent | 718269e2fa50e20227bfbb32b1a1b6ec8f78184d (diff) |
more fixes to maximizing docs to default to showing the same prototype each time.
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index a7aa571f8..020f764a2 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -177,6 +177,12 @@ export namespace Doc { return r || r2 || r3 || r4 ? true : false; } + // gets the document's prototype or returns the document if it is a prototype + export function GetProto(doc: Doc) { + return Object.getOwnPropertyNames(doc).indexOf("isPrototype") === -1 ? doc.proto! : doc; + } + + export function MakeAlias(doc: Doc) { const proto = Object.getOwnPropertyNames(doc).indexOf("isPrototype") === -1 ? doc.proto : undefined; const alias = new Doc; |