diff --git a/jerry-core/ecma/operations/ecma-objects.c b/jerry-core/ecma/operations/ecma-objects.c index 043fdccd4..857badb59 100644 --- a/jerry-core/ecma/operations/ecma-objects.c +++ b/jerry-core/ecma/operations/ecma-objects.c @@ -2357,6 +2357,12 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */ || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SET_ITERATOR_PROTOTYPE) #endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */ #endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */ +#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) + || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKMAP_PROTOTYPE) +#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */ +#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) + || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKSET_PROTOTYPE) +#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */ #if ENABLED (JERRY_ES2015) || ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE) #endif /* ENABLED (JERRY_ES2015) */ diff --git a/tests/jerry/es2015/weakmap.js b/tests/jerry/es2015/weakmap.js index c4ecd73c3..ff4e7286a 100644 --- a/tests/jerry/es2015/weakmap.js +++ b/tests/jerry/es2015/weakmap.js @@ -135,6 +135,8 @@ try { assert (e instanceof TypeError); } +assert (WeakMap.prototype.toString() === "[object WeakMap]"); + WeakMap.prototype.set = function () { throw "abrupt set" }; try { diff --git a/tests/jerry/es2015/weakset.js b/tests/jerry/es2015/weakset.js index f01a8634b..adb9bacab 100644 --- a/tests/jerry/es2015/weakset.js +++ b/tests/jerry/es2015/weakset.js @@ -119,6 +119,8 @@ try { assert (e instanceof TypeError); } +assert (WeakSet.prototype.toString() === "[object WeakSet]"); + WeakSet.prototype.add = function () { throw "abrupt add" }; try {