Skip to content

Commit

Permalink
Use an IIFE in deepEqual.js
Browse files Browse the repository at this point in the history
This code currently prevents tests from using |var join|.
  • Loading branch information
Ms2ger committed Nov 13, 2024
1 parent 2239b11 commit 8751847
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions harness/deepEqual.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ assert.deepEqual = function(actual, expected, message) {
);
};

(function() {
let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
let join = arr => arr.join(', ');
function stringFromTemplate(strings, ...subs) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8751847

Please sign in to comment.