mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Check options in ecma_op_object_get_own_property for typedarray. (#1627)
And add regression-case subfolder for es2015 Fix issue #1622 JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
This commit is contained in:
parent
b5a91069fd
commit
b13f78f19e
@ -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))
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
15
tests/jerry/es2015/regression-test-issue-1622.js
Normal file
15
tests/jerry/es2015/regression-test-issue-1622.js
Normal file
@ -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));
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user