diff --git a/jerry-core/ecma/operations/ecma-objects.c b/jerry-core/ecma/operations/ecma-objects.c index a66de6b07..3cc7a2cba 100644 --- a/jerry-core/ecma/operations/ecma-objects.c +++ b/jerry-core/ecma/operations/ecma-objects.c @@ -151,9 +151,17 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */ if (ECMA_STRING_GET_CONTAINER (property_name_p) == ECMA_STRING_CONTAINER_UINT32_IN_DESC) { ecma_value_t value = ecma_op_typedarray_get_index_prop (object_p, property_name_p->u.uint32_number); + if (!ecma_is_value_undefined (value)) { - property_ref_p->virtual_value = value; + if (options & ECMA_PROPERTY_GET_VALUE) + { + property_ref_p->virtual_value = value; + } + else + { + ecma_fast_free_value (value); + } return ECMA_PROPERTY_ENUMERABLE_WRITABLE | ECMA_PROPERTY_TYPE_VIRTUAL; } diff --git a/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-021.js b/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-021.js new file mode 100644 index 000000000..1f668bfeb --- /dev/null +++ b/tests/jerry-test-suite/es2015/22/22.02/22.02.01/22.02.01-021.js @@ -0,0 +1,22 @@ +/* Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +var a = new Float32Array([0.1, 0.2, 0.3]); + +var b = a.hasOwnProperty(1); +var c = a.hasOwnProperty(3); + +assert (b === true); +assert (c === false); diff --git a/tests/jerry/es2015/regression-test-issue-1622.js b/tests/jerry/es2015/regression-test-issue-1622.js new file mode 100644 index 000000000..5c2b0c242 --- /dev/null +++ b/tests/jerry/es2015/regression-test-issue-1622.js @@ -0,0 +1,15 @@ +// Copyright JS Foundation and other contributors, http://js.foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +for (var a in new Int8Array(123)); diff --git a/tools/run-tests.py b/tools/run-tests.py index 948fe3217..a0682fb17 100755 --- a/tools/run-tests.py +++ b/tools/run-tests.py @@ -81,6 +81,7 @@ jerry_tests_options = [ Options('jerry_tests-debug', ['--debug', '--cpointer-32bit=on', '--mem-heap=1024']), Options('jerry_tests-snapshot', ['--snapshot-save=on', '--snapshot-exec=on'], ['--snapshot']), Options('jerry_tests-debug-snapshot', ['--debug', '--snapshot-save=on', '--snapshot-exec=on'], ['--snapshot']), + Options('jerry_tests-es2015-subset-debug', ['--debug', '--profile=es2015-subset']) ] # Test options for jerry-test-suite @@ -91,7 +92,6 @@ jerry_test_suite_options.append(Options('jerry_test_suite-minimal-debug', ['--de jerry_test_suite_options.append(Options('jerry_test_suite-minimal-debug-snapshot', ['--debug', '--profile=minimal', '--snapshot-save=on', '--snapshot-exec=on'], ['--snapshot'])) jerry_test_suite_options.append(Options('jerry_test_suite-es2015-subset', ['--profile=es2015-subset'])) jerry_test_suite_options.append(Options('jerry_test_suite-es2015-subset-snapshot', ['--profile=es2015-subset', '--snapshot-save=on', '--snapshot-exec=on'], ['--snapshot'])) -jerry_test_suite_options.append(Options('jerry_test_suite-es2015-subset-debug', ['--debug', '--profile=es2015-subset'])) jerry_test_suite_options.append(Options('jerry_test_suite-es2015-subset-debug-snapshot', ['--debug', '--profile=es2015-subset', '--snapshot-save=on', '--snapshot-exec=on'], ['--snapshot'])) # Test options for test262 @@ -185,8 +185,16 @@ def run_jerry_tests(): break test_cmd = [TEST_RUNNER_SCRIPT, get_binary_path(job.out_dir), JERRY_TESTS_DIR] + skip_list = [] + + if '--profile=es2015-subset' not in job.build_args: + skip_list.append("es2015\/") + if script_args.skip_list: - test_cmd.append("--skip-list=" + script_args.skip_list) + skip_list.append(script_args.skip_list) + + if skip_list: + test_cmd.append("--skip-list=" + ",".join(skip_list)) if job.test_args: test_cmd.extend(job.test_args) diff --git a/tools/runners/run-test-suite.sh b/tools/runners/run-test-suite.sh index 460d532c7..011281044 100755 --- a/tools/runners/run-test-suite.sh +++ b/tools/runners/run-test-suite.sh @@ -74,7 +74,7 @@ fi # Remove the skipped tests from list for TEST in "${SKIP_LIST[@]}" do - ( sed -i "/$TEST/d" $TEST_FILES ) + ( sed -i -r "/$TEST/d" $TEST_FILES ) done TOTAL=$(cat $TEST_FILES | wc -l)