Fix class name check for WeakMap and WeakSet prototype (#3358)
Fixes #3357. JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
committed by
Robert Fancsik
parent
62356796fc
commit
1c6f334f62
@@ -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) */
|
||||
|
||||
@@ -135,6 +135,8 @@ try {
|
||||
assert (e instanceof TypeError);
|
||||
}
|
||||
|
||||
assert (WeakMap.prototype.toString() === "[object WeakMap]");
|
||||
|
||||
WeakMap.prototype.set = function () { throw "abrupt set" };
|
||||
|
||||
try {
|
||||
|
||||
@@ -119,6 +119,8 @@ try {
|
||||
assert (e instanceof TypeError);
|
||||
}
|
||||
|
||||
assert (WeakSet.prototype.toString() === "[object WeakSet]");
|
||||
|
||||
WeakSet.prototype.add = function () { throw "abrupt add" };
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user