Skip to content

Commit 63b6fd1

Browse files
authored
Add the class name of promise.prototype (#1766)
Fix Issue: 1765 JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang [email protected]
1 parent 67c641e commit 63b6fd1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,9 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
16821682
{
16831683
#ifndef JERRY_NDEBUG
16841684
return (ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_GLOBAL)
1685+
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
1686+
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_PROMISE_PROTOTYPE)
1687+
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
16851688
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
16861689
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE)
16871690
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_TYPEDARRAY_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+
Function()(Promise.prototype.toLocaleString())

0 commit comments

Comments
 (0)