From c21919a2105bd1ed4f060be149624d064739a36c Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 7 Mar 2022 12:14:39 -0500 Subject: got rid of include cycles for Scripting globals to make hot updates work better. --- src/fields/List.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fields/List.ts') diff --git a/src/fields/List.ts b/src/fields/List.ts index 93a8d1d60..60bf442d4 100644 --- a/src/fields/List.ts +++ b/src/fields/List.ts @@ -1,7 +1,7 @@ import { action, observable } from "mobx"; import { alias, list, serializable } from "serializr"; import { DocServer } from "../client/DocServer"; -import { Scripting } from "../client/util/Scripting"; +import { ScriptingGlobals } from "../client/util/ScriptingGlobals"; import { afterDocDeserialize, autoObject, Deserializable } from "../client/util/SerializationHelper"; import { Field } from "./Doc"; import { Copy, OnUpdate, Parent, Self, SelfProxy, ToScriptString, ToString, Update } from "./FieldSymbols"; @@ -327,8 +327,8 @@ class ListImpl extends ObjectField { export type List = ListImpl & (T | (T extends RefField ? Promise : never))[]; export const List: { new (fields?: T[]): List } = ListImpl as any; -Scripting.addGlobal("List", List); -Scripting.addGlobal(function compareLists(l1: any, l2: any) { +ScriptingGlobals.add("List", List); +ScriptingGlobals.add(function compareLists(l1: any, l2: any) { const L1 = Cast(l1, listSpec("string"), []); const L2 = Cast(l2, listSpec("string"), []); return !L1 && !L2 ? true : L1 && L2 && L1.length === L2.length && L2.reduce((p, v) => p && L1.includes(v), true); -- cgit v1.2.3-70-g09d2