diff --git a/jerry-core/ecma/operations/ecma-atomics-object.c b/jerry-core/ecma/operations/ecma-atomics-object.c index 25a7349c8..6e2cfd0e9 100644 --- a/jerry-core/ecma/operations/ecma-atomics-object.c +++ b/jerry-core/ecma/operations/ecma-atomics-object.c @@ -51,9 +51,9 @@ ecma_validate_shared_integer_typedarray (ecma_value_t typedarray, /**< typedArra bool waitable) /**< waitable argument */ { /* 2. */ - if (!ecma_is_value_object (typedarray)) + if (!ecma_is_typedarray (typedarray)) { - return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT); + return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY); } /* 3-4. */ diff --git a/tests/jerry/es.next/regression-test-issue-4875.js b/tests/jerry/es.next/regression-test-issue-4875.js new file mode 100644 index 000000000..e7bdfeeff --- /dev/null +++ b/tests/jerry/es.next/regression-test-issue-4875.js @@ -0,0 +1,20 @@ +// 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. + +try { + Atomics.sub({}); + assert(false); +} catch (e) { + assert(e instanceof TypeError); +} diff --git a/tests/test262-esnext-excludelist.xml b/tests/test262-esnext-excludelist.xml index fb3720040..cde4a265f 100644 --- a/tests/test262-esnext-excludelist.xml +++ b/tests/test262-esnext-excludelist.xml @@ -2601,13 +2601,11 @@ - - @@ -2625,14 +2623,12 @@ - - @@ -2677,7 +2673,6 @@ - @@ -2694,7 +2689,6 @@ - @@ -2773,7 +2767,6 @@ -