From cf32f8adea521f65c83eededbea016154038f4f9 Mon Sep 17 00:00:00 2001 From: Templin Konstantin Date: Fri, 12 Sep 2025 13:10:02 +0300 Subject: [PATCH] Move DataView to std.core package Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICXLZ6 Description: - Move DataView to std.core package All required pre-merge tests passed. Results are available in the internal CI. Signed-off-by: Templin Konstantin --- static_core/plugins/ets/GenerateStdLib.cmake | 4 ++-- static_core/plugins/ets/stdlib/escompat/ArrayBuffer.ets | 2 +- .../plugins/ets/stdlib/{escompat => std/core}/DataView.ets | 2 +- static_core/plugins/ets/templates/stdlib/DataView.ets.j2 | 2 +- static_core/plugins/ets/templates/stdlib/genlib.sh | 2 +- .../ets/tests/stdlib-templates/spec/generic/issue14700.ets | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) rename static_core/plugins/ets/stdlib/{escompat => std/core}/DataView.ets (99%) diff --git a/static_core/plugins/ets/GenerateStdLib.cmake b/static_core/plugins/ets/GenerateStdLib.cmake index 3bfde506ac..c1720583d0 100644 --- a/static_core/plugins/ets/GenerateStdLib.cmake +++ b/static_core/plugins/ets/GenerateStdLib.cmake @@ -15,9 +15,9 @@ function(regenerate_and_check_stdlib) # NOTE(ivan-tyulyandin): add array.sh and related generated files # Preparations to check generated against used code equality set(ESCOMPAT "stdlib/escompat") - set(ESCOMPAT_GEN_FILES "DataView.ets" "TypedUArrays.ets" "TypedArrays.ets" "Array.ets") + set(ESCOMPAT_GEN_FILES "TypedUArrays.ets" "TypedArrays.ets" "Array.ets") set(STD_CORE "stdlib/std/core") - set(STD_CORE_GEN_FILES "Function.ets" "Tuple.ets" "BuiltinArray.ets" "BuiltinArraySort.ets" "BuiltinArrayAlgorithms.ets") + set(STD_CORE_GEN_FILES "DataView.ets" "Function.ets" "Tuple.ets" "BuiltinArray.ets" "BuiltinArraySort.ets" "BuiltinArrayAlgorithms.ets") set(STD_INTEROP "stdlib/std/interop/js") set(STD_INTEROP_GEN_FILES "InteropTransferHelper.ets") set(GEN_FILES ) diff --git a/static_core/plugins/ets/stdlib/escompat/ArrayBuffer.ets b/static_core/plugins/ets/stdlib/escompat/ArrayBuffer.ets index f4bcea2374..9595641c64 100644 --- a/static_core/plugins/ets/stdlib/escompat/ArrayBuffer.ets +++ b/static_core/plugins/ets/stdlib/escompat/ArrayBuffer.ets @@ -19,7 +19,7 @@ package escompat; * Either ArrayBuffer */ // NOTE (kprokopenko): make abstract after abstract overloads get to work -abstract class Buffer { +export abstract class Buffer { abstract getByteLength(): int abstract at(i: int): byte abstract set(i: int, b: byte) diff --git a/static_core/plugins/ets/stdlib/escompat/DataView.ets b/static_core/plugins/ets/stdlib/std/core/DataView.ets similarity index 99% rename from static_core/plugins/ets/stdlib/escompat/DataView.ets rename to static_core/plugins/ets/stdlib/std/core/DataView.ets index d1db0e15ac..634c9a2109 100644 --- a/static_core/plugins/ets/stdlib/escompat/DataView.ets +++ b/static_core/plugins/ets/stdlib/std/core/DataView.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -package escompat; +package std.core; export final class DataView implements ArrayBufferView { /** Underlying buffer */ diff --git a/static_core/plugins/ets/templates/stdlib/DataView.ets.j2 b/static_core/plugins/ets/templates/stdlib/DataView.ets.j2 index eec34ba5fb..83dc89838c 100644 --- a/static_core/plugins/ets/templates/stdlib/DataView.ets.j2 +++ b/static_core/plugins/ets/templates/stdlib/DataView.ets.j2 @@ -13,7 +13,7 @@ * limitations under the License. */ -package escompat; +package std.core; export final class DataView implements ArrayBufferView { /** Underlying buffer */ diff --git a/static_core/plugins/ets/templates/stdlib/genlib.sh b/static_core/plugins/ets/templates/stdlib/genlib.sh index 7a91a491ca..3c13115af4 100755 --- a/static_core/plugins/ets/templates/stdlib/genlib.sh +++ b/static_core/plugins/ets/templates/stdlib/genlib.sh @@ -24,7 +24,7 @@ readonly ARR="${GEN_ESCOMPAT_PATH}/Array.ets" readonly BLT_ARR="${GEN_STDCORE_PATH}/BuiltinArray.ets" readonly BLT_ARR_SORT="${GEN_STDCORE_PATH}/BuiltinArraySort.ets" readonly BLT_ARR_ARG="${GEN_STDCORE_PATH}/BuiltinArrayAlgorithms.ets" -readonly DATAVIEW="${GEN_ESCOMPAT_PATH}/DataView.ets" +readonly DATAVIEW="${GEN_STDCORE_PATH}/DataView.ets" readonly TYPED_ARR="${GEN_ESCOMPAT_PATH}/TypedArrays.ets" readonly TYPED_UARR="${GEN_ESCOMPAT_PATH}/TypedUArrays.ets" readonly FUNC="${GEN_STDCORE_PATH}/Function.ets" diff --git a/static_core/plugins/ets/tests/stdlib-templates/spec/generic/issue14700.ets b/static_core/plugins/ets/tests/stdlib-templates/spec/generic/issue14700.ets index 2946c518f0..58cd8c4f3c 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/spec/generic/issue14700.ets +++ b/static_core/plugins/ets/tests/stdlib-templates/spec/generic/issue14700.ets @@ -22,10 +22,10 @@ tags: [] ---*/ -class Buffer { +class BufferA { } -class TestArrayBuffer extends Buffer { +class TestArrayBuffer extends BufferA { constructor(size: number) { } } -- Gitee