From f2c6adaab8b302fe26c2b4954da3f70451254a4e Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sat, 4 Jan 2025 18:55:39 +0800 Subject: [PATCH] fix goofy ahh bug --- postinit.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/postinit.js b/postinit.js index 51b112d..e93081c 100644 --- a/postinit.js +++ b/postinit.js @@ -374,18 +374,14 @@ globalThis.modapi_postinit = "(" + (() => { } } - //Iteratively load the superclasses' prototype methods. + //Make it extend the parent. Used to iteratively load the superclasses' prototype methods. ModAPI.reflect.prototypeStack = function prototypeStack(reflectClass, classFn) { - var stack = [reflectClass.class.prototype]; - var currentSuperclass = reflectClass.superclass; - while (currentSuperclass) { - stack.push(currentSuperclass.prototype); - currentSuperclass = currentSuperclass?.$meta?.superclass; - } - stack.reverse(); - stack.forEach(proto => { - Object.assign(classFn.prototype, proto); - }); + classFn.prototype = Object.create(reflectClass.class.prototype); + classFn.prototype.constructor = classFn; + classFn.$meta = { + item: null, + supertypes: [reflectClass.class] + }; } var reloadDeprecationWarnings = 0;