mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
lib: prefer logical assignment
PR-URL: https://github.com/nodejs/node/pull/55044 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name>
This commit is contained in:
1 parent
09d10b50dc
commit
71785889c8
73 files changed
+172
-296
No files matched your search
@@ -13,7 +13,7 @@ function addLibraryPath(env) {
|
||||
return;
|
||||
}
|
||||
|
||||
env = env || process.env;
|
||||
env ||= process.env;
|
||||
|
||||
env.LD_LIBRARY_PATH =
|
||||
(env.LD_LIBRARY_PATH ? env.LD_LIBRARY_PATH + path.delimiter : '') +
|
||||
|
||||
+3
-9
@@ -878,22 +878,16 @@ class WPTRunner {
|
||||
|
||||
addTestResult(spec, item) {
|
||||
let result = this.results[spec.filename];
|
||||
if (!result) {
|
||||
result = this.results[spec.filename] = {};
|
||||
}
|
||||
result ||= this.results[spec.filename] = {};
|
||||
if (item.status === kSkip) {
|
||||
// { filename: { skip: 'reason' } }
|
||||
result[kSkip] = item.reason;
|
||||
} else {
|
||||
// { filename: { fail: { expected: [ ... ],
|
||||
// unexpected: [ ... ] } }}
|
||||
if (!result[item.status]) {
|
||||
result[item.status] = {};
|
||||
}
|
||||
result[item.status] ||= {};
|
||||
const key = item.expected ? 'expected' : 'unexpected';
|
||||
if (!result[item.status][key]) {
|
||||
result[item.status][key] = [];
|
||||
}
|
||||
result[item.status][key] ||= [];
|
||||
const hasName = result[item.status][key].includes(item.name);
|
||||
if (!hasName) {
|
||||
result[item.status][key].push(item.name);
|
||||
|
||||
Reference in new issue
Block a user