Use an IIFE in deepEqual.js

This code currently prevents tests from using |var join|.
This commit is contained in:
Ms2ger 2024-11-13 14:13:14 +01:00 committed by Philip Chimento
parent 62d48cf9ed
commit 6ec99623c2
1 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ assert.deepEqual = function(actual, expected, message) {
);
};
(function() {
let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
let join = arr => arr.join(', ');
function stringFromTemplate(strings, ...subs) {
@ -131,6 +132,7 @@ assert.deepEqual.format = function(value, seen) {
let contents = keys.map(key => lazyString`${escapeKey(key)}: ${format(value[key], seen)}`);
return lazyResult`${tag ? `${tag} ` : ''}{${contents}}`(String, join);
};
})();
assert.deepEqual._compare = (function () {
var EQUAL = 1;