Scripting: Code cleanup

This commit is contained in:
Vicki Pfau 2023-09-16 01:20:55 -07:00
parent 0c675b12e4
commit efb30080e8
2 changed files with 2 additions and 10 deletions

View File

@ -354,11 +354,7 @@ bool call(struct mScriptValue* obj, const char* method, struct mScriptFrame* fra
if (!mScriptObjectGet(obj, method, &fn)) { if (!mScriptObjectGet(obj, method, &fn)) {
return false; return false;
} }
struct mScriptValue* this = mScriptListAppend(&frame->arguments); mSCRIPT_PUSH(&frame->arguments, WRAPPER, obj);
this->type = mSCRIPT_TYPE_MS_WRAPPER;
this->refs = mSCRIPT_VALUE_UNREF;
this->flags = 0;
this->value.opaque = obj;
return mScriptInvoke(&fn, frame); return mScriptInvoke(&fn, frame);
} }

View File

@ -1667,11 +1667,7 @@ void mScriptObjectFree(struct mScriptValue* value) {
if (_accessRawMember(value->type->details.cls->free, value->value.opaque, value->type->isConst, &deinitMember)) { if (_accessRawMember(value->type->details.cls->free, value->value.opaque, value->type->isConst, &deinitMember)) {
struct mScriptFrame frame; struct mScriptFrame frame;
mScriptFrameInit(&frame); mScriptFrameInit(&frame);
struct mScriptValue* this = mScriptListAppend(&frame.arguments); mSCRIPT_PUSH(&frame.arguments, WRAPPER, value);
this->type = mSCRIPT_TYPE_MS_WRAPPER;
this->refs = mSCRIPT_VALUE_UNREF;
this->flags = 0;
this->value.opaque = value;
mScriptInvoke(&deinitMember, &frame); mScriptInvoke(&deinitMember, &frame);
mScriptFrameDeinit(&frame); mScriptFrameDeinit(&frame);
} }