From 7aacc8c2eba66bea421f9d188784e493db3a7b71 Mon Sep 17 00:00:00 2001 From: yp9522 Date: Sun, 29 Jun 2025 16:36:41 +0800 Subject: [PATCH] Fix record for exported 'this' return. Fix record for exported 'this' return. Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICIK4K Signed-off-by: yp9522 --- ets2panda/compiler/core/ETSemitter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ets2panda/compiler/core/ETSemitter.cpp b/ets2panda/compiler/core/ETSemitter.cpp index 3e6f38dbad..6b02a7ef32 100644 --- a/ets2panda/compiler/core/ETSemitter.cpp +++ b/ets2panda/compiler/core/ETSemitter.cpp @@ -136,6 +136,9 @@ static pandasm::Function GenScriptFunction(const ir::ScriptFunction *scriptFunc, if (scriptFunc->IsConstructor() || scriptFunc->IsStaticBlock()) { func.returnType = pandasm::Type(Signatures::PRIMITIVE_VOID, 0); + } else if (scriptFunc->Signature()->HasSignatureFlag(checker::SignatureFlags::THIS_RETURN_TYPE) && + scriptFunc->Signature()->HasSignatureFlag(checker::SignatureFlags::EXTENSION_FUNCTION)) { + func.returnType = PandasmTypeWithRank(paramScope->Params()[0]->TsType()); } else { func.returnType = PandasmTypeWithRank(scriptFunc->Signature()->ReturnType()); } -- Gitee