Skip to content

Commit c2eb9ce

Browse files
author
Robert Fancsik
authored
Fix object class check for builtin Atomics (#4889)
This patch fixes #4884. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
1 parent bcc711e commit c2eb9ce

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

jerry-core/ecma/operations/ecma-objects.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2986,6 +2986,12 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
29862986
return LIT_MAGIC_STRING_JSON_U;
29872987
}
29882988
#endif /* JERRY_BUILTIN_JSON */
2989+
#if JERRY_BUILTIN_ATOMICS
2990+
case ECMA_BUILTIN_ID_ATOMICS:
2991+
{
2992+
return LIT_MAGIC_STRING_ATOMICS_U;
2993+
}
2994+
#endif /* JERRY_BUILTIN_ATOMICS */
29892995
#if !JERRY_ESNEXT
29902996
#if JERRY_BUILTIN_ERRORS
29912997
case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright JS Foundation and other contributors, http://js.foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
assert(Object.prototype.toString.call(Atomics) === '[object Atomics]');

0 commit comments

Comments
 (0)