From eabbbc9e4e3fb618853f9cc7f93df40ff46c80d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E4=BA=91=E9=A3=9E?= Date: Sat, 12 Apr 2025 14:29:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8E=9F=E5=9E=8B=E9=93=BE?= =?UTF-8?q?=E8=A2=AB=E4=BF=AE=E6=94=B9=E6=97=B6=E7=9B=91=E5=90=AC=E5=99=A8?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=96=AD=E8=A8=80=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IBSG67 Signed-off-by: 杨云飞 --- ecmascript/js_hclass.cpp | 3 ++- test/moduletest/propertydetector/expect_output.txt | 1 + test/moduletest/propertydetector/propertydetector.js | 9 ++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ecmascript/js_hclass.cpp b/ecmascript/js_hclass.cpp index 2f2755cfb2..4a8248213e 100644 --- a/ecmascript/js_hclass.cpp +++ b/ecmascript/js_hclass.cpp @@ -1097,8 +1097,9 @@ void JSHClass::RefreshUsers(const JSThread *thread, const JSHandle &ol if (!newHclass->GetProtoChangeDetails().IsProtoChangeDetails()) { newHclass->SetProtoChangeDetails(thread, oldHclass->GetProtoChangeDetails()); } - oldHclass->SetProtoChangeDetails(thread, JSTaggedValue::Undefined()); if (onceRegistered) { + ProtoChangeDetails::Cast(oldHclass->GetProtoChangeDetails().GetTaggedObject()) + ->SetRegisterIndex(ProtoChangeDetails::UNREGISTERED); if (newHclass->GetProtoChangeDetails().IsProtoChangeDetails()) { ProtoChangeDetails::Cast(newHclass->GetProtoChangeDetails().GetTaggedObject()) ->SetRegisterIndex(ProtoChangeDetails::UNREGISTERED); diff --git a/test/moduletest/propertydetector/expect_output.txt b/test/moduletest/propertydetector/expect_output.txt index d6ce59a8ef..3fad04a919 100644 --- a/test/moduletest/propertydetector/expect_output.txt +++ b/test/moduletest/propertydetector/expect_output.txt @@ -25,3 +25,4 @@ false false true false +RegisterOnProtoChain success diff --git a/test/moduletest/propertydetector/propertydetector.js b/test/moduletest/propertydetector/propertydetector.js index 9475f0dfe5..104f971e81 100644 --- a/test/moduletest/propertydetector/propertydetector.js +++ b/test/moduletest/propertydetector/propertydetector.js @@ -60,4 +60,11 @@ print(ArkTools.isRegExpReplaceDetectorValid()) print(ArkTools.isNumberStringNotRegexpLikeDetectorValid()); String.prototype[Symbol.matchAll] = function () {return "aaa"} -print(ArkTools.isNumberStringNotRegexpLikeDetectorValid()); \ No newline at end of file +print(ArkTools.isNumberStringNotRegexpLikeDetectorValid()); + +for (let i = 0; i < 15; i++) { + let __proto__ = ['a', 'b']; + 0x3fffffff.__proto__.__proto__ = [1, 2, 3]; + __proto__.var06 = 1; +} +print("RegisterOnProtoChain success"); -- Gitee