Fix function-valued properties in propertyBagObserver

A property in the property bag we want to observe may be a function, in
which case we don't want to treat it as a primitive and create a
toPrimitiveObserver for it.

(Also handle the null case, in which we should fall through to return a
toPrimitiveObserver.)
This commit is contained in:
Philip Chimento 2023-02-23 18:21:41 -08:00 committed by Ms2ger
parent 4f5eb40ee0
commit ba1e51c8e7
1 changed files with 1 additions and 1 deletions

View File

@ -1669,7 +1669,7 @@ var TemporalHelpers = {
if (result === undefined) {
return undefined;
}
if (typeof result === "object") {
if ((result !== null && typeof result === "object") || typeof result === "function") {
return result;
}
return TemporalHelpers.toPrimitiveObserver(calls, result, `${formatPropertyName(key, objectName)}`);