mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
9dbb7af064
--HG-- extra : rebase_source : 9cdf65c3570474f543a2e9cdaf9554a62e627559
20 lines
696 B
JavaScript
20 lines
696 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
/**
|
|
* Recursively compare two objects and check that every property of expectedObj has the same value
|
|
* on actualObj.
|
|
*/
|
|
function isSubObjectOf(expectedObj, actualObj, name) {
|
|
for (let prop in expectedObj) {
|
|
if (typeof expectedObj[prop] == 'function')
|
|
continue;
|
|
if (expectedObj[prop] instanceof Object) {
|
|
is(actualObj[prop].length, expectedObj[prop].length, name + "[" + prop + "]");
|
|
isSubObjectOf(expectedObj[prop], actualObj[prop], name + "[" + prop + "]");
|
|
} else {
|
|
is(actualObj[prop], expectedObj[prop], name + "[" + prop + "]");
|
|
}
|
|
}
|
|
}
|