diff --git a/modern/src/maki-interpreter/objects.test.js b/modern/src/maki-interpreter/objects.test.js index 432a90c0..3f8c7778 100644 --- a/modern/src/maki-interpreter/objects.test.js +++ b/modern/src/maki-interpreter/objects.test.js @@ -27,7 +27,7 @@ for (let [key, Klass] of Object.entries(runtime)) { }); } -test("Track all missing methods", () => { +describe("Maki classes", () => { const runtimeMethods = new Set(); const objectMethods = new Set(); for (let [key, Klass] of Object.entries(runtime)) { @@ -40,9 +40,31 @@ test("Track all missing methods", () => { }); } - const missing = [...objectMethods].filter(x => !runtimeMethods.has(x)).sort(); + test("have no extra methods", () => { + // getclassname _should_ be implemented on Object and let each class inherit + // it. However it's far easier to implement it on each class directly, so + // we'll allow that. + function isntGetClassname(method) { + return !/\.getclassname$/.test(method); + } - expect(missing).toMatchInlineSnapshot(` + function isntMakiMethod(method) { + return !objectMethods.has(method); + } + + const extra = [...runtimeMethods] + .filter(isntMakiMethod) + .filter(isntGetClassname); + + expect(extra).toEqual([]); + }); + + test("Track all missing methods", () => { + const missing = [...objectMethods] + .filter(x => !runtimeMethods.has(x)) + .sort(); + + expect(missing).toMatchInlineSnapshot(` Array [ "AnimatedLayer.getautoreplay", "AnimatedLayer.getcurframe", @@ -696,4 +718,5 @@ Array [ "Wac.show", ] `); + }); }); diff --git a/modern/src/runtime/GuiObject.js b/modern/src/runtime/GuiObject.js index 33ce2565..14fe410b 100644 --- a/modern/src/runtime/GuiObject.js +++ b/modern/src/runtime/GuiObject.js @@ -22,11 +22,6 @@ class GuiObject extends MakiObject { return findDescendantByTypeAndId(this, null, id); } - getobject(id) { - // Not sure this is correct, but it is my understanding this is just an alias - return this.findobject(id); - } - init(newRoot) { this.parent = newRoot; newRoot.js_addChild(this); @@ -78,6 +73,11 @@ class GuiObject extends MakiObject { this.attributes.y = y; this.attributes.w = w; this.attributes.h = h; + // TODO: Confirm that GuiObject actually supports these min/max attributes + this.attributes.minimum_w = w; + this.attributes.maximum_w = w; + this.attributes.minimum_h = h; + this.attributes.maximum_h = h; } } diff --git a/modern/src/runtime/Layout.js b/modern/src/runtime/Layout.js index 9b504301..f0710923 100644 --- a/modern/src/runtime/Layout.js +++ b/modern/src/runtime/Layout.js @@ -15,15 +15,6 @@ class Layout extends Group { getcontainer() { return findParentNodeOfType(this, new Set(["container"])); } - - resize(x, y, w, h) { - this.attributes.x = x; - this.attributes.y = y; - this.attributes.minimum_w = w; - this.attributes.maximum_w = w; - this.attributes.minimum_h = h; - this.attributes.maximum_h = h; - } } export default Layout;