diff --git a/build/conformance.textproto b/build/conformance.textproto index cab5f4d826..510fc22ca6 100644 --- a/build/conformance.textproto +++ b/build/conformance.textproto @@ -393,3 +393,11 @@ requirement: { error_message: "Using \"Array.flat\" is not allowed because is not supported on Tizen 3." } + +requirement: { + type: BANNED_PROPERTY_CALL + value: "Object.prototype.fromEntries" + error_message: + "Using \"Object.fromEntries\" is not allowed because is not supported on " + "Tizen 3." +} diff --git a/lib/util/config_utils.js b/lib/util/config_utils.js index bdb1eaa594..f7694fc1a6 100644 --- a/lib/util/config_utils.js +++ b/lib/util/config_utils.js @@ -169,23 +169,23 @@ shaka.util.ConfigUtils = class { }; const changes = (object, base) => { - return Object.fromEntries( - Object.entries(object).reduce((acc, [key, value]) => { - // eslint-disable-next-line no-prototype-builtins - if (!base.hasOwnProperty(key)) { - acc.push([key, value]); - } else if (isObject(value) && isObject(base[key])) { - const diff = changes(value, base[key]); - if (Object.keys(diff).length > 0 || !isObject(diff)) { - acc.push([key, diff]); - } - } else if (isArrayEmpty(value) && isArrayEmpty(base[key])) { - // Do nothing if both are empty arrays - } else if (value !== base[key]) { - acc.push([key, value]); - } - return acc; - }, [])); + return Object.keys(object).reduce((acc, key) => { + const value = object[key]; + // eslint-disable-next-line no-prototype-builtins + if (!base.hasOwnProperty(key)) { + acc[key] = value; + } else if (isObject(value) && isObject(base[key])) { + const diff = changes(value, base[key]); + if (Object.keys(diff).length > 0 || !isObject(diff)) { + acc[key] = diff; + } + } else if (isArrayEmpty(value) && isArrayEmpty(base[key])) { + // Do nothing if both are empty arrays + } else if (value !== base[key]) { + acc[key] = value; + } + return acc; + }, {}); }; const diff = changes(object, base);