From 498fddf87a67a6cee69329b5c7e20808d92907df Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Mon, 14 Oct 2019 09:01:25 -0700 Subject: [PATCH] Allow group to be initialized with all nulls --- modern/src/Actions.ts | 2 +- modern/src/runtime/GuiObject.ts | 6 +++++- modern/src/runtime/System.ts | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modern/src/Actions.ts b/modern/src/Actions.ts index c7a0a694..425114ca 100644 --- a/modern/src/Actions.ts +++ b/modern/src/Actions.ts @@ -74,7 +74,7 @@ export function gotSkinZip(zip: JSZip, store: ModernStore): Thunk { dispatch(setXmlTree(xmlTree)); - const makiTree = await initialize(zip, xmlTree); + const makiTree: MakiObject = await initialize(zip, xmlTree); // Execute scripts await Utils.asyncTreeFlatMap(makiTree, async (node: MakiObject) => { if (!(node instanceof JsScript)) { diff --git a/modern/src/runtime/GuiObject.ts b/modern/src/runtime/GuiObject.ts index 356d70cd..199c3a2e 100644 --- a/modern/src/runtime/GuiObject.ts +++ b/modern/src/runtime/GuiObject.ts @@ -33,7 +33,11 @@ class GuiObject extends MakiObject { _transitionParams: TransitionParams; _targetAnimationStartTime: number; _targetAnimationCancelID: number | null; - constructor(node: XmlNode, parent: MakiObject, annotations: Object = {}) { + constructor( + node: XmlNode | null, + parent: MakiObject | null, + annotations: Object = {} + ) { super(node, parent, annotations); this._setAttributeDefaults(); diff --git a/modern/src/runtime/System.ts b/modern/src/runtime/System.ts index bd18e521..1175dcee 100644 --- a/modern/src/runtime/System.ts +++ b/modern/src/runtime/System.ts @@ -12,7 +12,7 @@ import Layout from "./Layout"; import GuiObject from "./GuiObject"; class System extends MakiObject { - _scriptGroup: Group; + _scriptGroup: MakiObject; _root: MakiObject; _store: ModernStore; _privateInt: Map>; @@ -21,7 +21,8 @@ class System extends MakiObject { super(null, null); this._store = store; - this._scriptGroup = scriptGroup == null ? new Group() : scriptGroup; + this._scriptGroup = + scriptGroup == null ? new Group(null, null) : scriptGroup; this._root = this._scriptGroup; while (this._root.parent) { this._root = this._root.parent;