mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 22:45:10 +02:00
Use an IIFE in deepEqual.js
This code currently prevents tests from using |var join|.
This commit is contained in:
parent
62d48cf9ed
commit
6ec99623c2
@ -14,6 +14,7 @@ assert.deepEqual = function(actual, expected, message) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(function() {
|
||||||
let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
||||||
let join = arr => arr.join(', ');
|
let join = arr => arr.join(', ');
|
||||||
function stringFromTemplate(strings, ...subs) {
|
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)}`);
|
let contents = keys.map(key => lazyString`${escapeKey(key)}: ${format(value[key], seen)}`);
|
||||||
return lazyResult`${tag ? `${tag} ` : ''}{${contents}}`(String, join);
|
return lazyResult`${tag ? `${tag} ` : ''}{${contents}}`(String, join);
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
assert.deepEqual._compare = (function () {
|
assert.deepEqual._compare = (function () {
|
||||||
var EQUAL = 1;
|
var EQUAL = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user