From d6d40469e89e9424bdfef67a05453598ec083007 Mon Sep 17 00:00:00 2001 From: Ishin Pavel Date: Thu, 16 Mar 2023 17:00:03 +0300 Subject: [PATCH] Add test to prototype Signed-off-by: Ishin Pavel --- tests/checked/CMakeLists.txt | 1 + tests/checked/prototype_array.js | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 tests/checked/prototype_array.js diff --git a/tests/checked/CMakeLists.txt b/tests/checked/CMakeLists.txt index b008ca9fc..dda4a329d 100644 --- a/tests/checked/CMakeLists.txt +++ b/tests/checked/CMakeLists.txt @@ -107,6 +107,7 @@ if (NOT PANDA_TARGET_ARM32) panda_add_checked_test_ecma(FILE ${CMAKE_CURRENT_SOURCE_DIR}/ecma_inlining_deoptimize.js SUPPORT_RELEASE true) panda_add_checked_test_ecma(FILE ${CMAKE_CURRENT_SOURCE_DIR}/ecma_call_profile_clear.js SUPPORT_RELEASE true) panda_add_checked_test_ecma(FILE ${CMAKE_CURRENT_SOURCE_DIR}/peephole_negoverflowandzerocheck.js SUPPORT_RELEASE true) + panda_add_checked_test_ecma(FILE ${CMAKE_CURRENT_SOURCE_DIR}/prototype_array.js SUPPORT_RELEASE true) # there is flaky bug when turning on TSAN if (NOT PANDA_ENABLE_THREAD_SANITIZER) panda_add_checked_test_ecma(FILE ${CMAKE_CURRENT_SOURCE_DIR}/acc_after_deopt.js SUPPORT_RELEASE true) diff --git a/tests/checked/prototype_array.js b/tests/checked/prototype_array.js new file mode 100644 index 000000000..f00fafacf --- /dev/null +++ b/tests/checked/prototype_array.js @@ -0,0 +1,9 @@ +//! CHECKER Test prototype array +//! RUN options: "--compiler-enable-jit=false", entry: "_GLOBAL::func_main_0" + +function getset(f) { f.length = 16; f.length; } + +function foo() {} +foo.prototype = new Array(1, 2, 3); +var f = new foo(); +getset(f) \ No newline at end of file -- Gitee