GeezerVison is showing github.com — lib,test,tools: alignment on variable assignments · nodejs/node@aaeeec4
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/child_process.js +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -458,9 +458,10 @@ function checkExecSyncError(ret) { | 458 | 458 | ret.error = null; | 459 | 459 |
| 460 | 460 | if (!err) { | 461 | | - var msg = 'Command failed: ' + | 462 | | - (ret.cmd ? ret.cmd : ret.args.join(' ')) + | 463 | | - (ret.stderr ? '\n' + ret.stderr.toString() : ''); | | 461 | + var msg = 'Command failed: '; | | 462 | + msg += ret.cmd || ret.args.join(' '); | | 463 | + if (ret.stderr) | | 464 | + msg += '\n' + ret.stderr.toString(); | 464 | 465 | err = new Error(msg); | 465 | 466 | } | 466 | 467 |
| |
Collapse file Copy file name to clipboardExpand all lines: lib/repl.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,8 +70,8 @@ exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster', | 70 | 70 | 'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib']; | 71 | 71 |
| 72 | 72 |
| 73 | | -const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, ' + | 74 | | - 'const, function, class) not yet supported outside strict mode'; | | 73 | +const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, const, function, ' + | | 74 | + 'class) not yet supported outside strict mode'; | 75 | 75 |
| 76 | 76 |
| 77 | 77 | class LineParser { | |
Collapse file Copy file name to clipboardExpand all lines: lib/util.js +6-3Lines changed: 6 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -426,9 +426,12 @@ function formatPrimitive(ctx, value) { | 426 | 426 | var type = typeof value; | 427 | 427 |
| 428 | 428 | if (type === 'string') { | 429 | | - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') | 430 | | - .replace(/'/g, "\\'") | 431 | | - .replace(/\\"/g, '"') + '\''; | | 429 | + var simple = '\'' + | | 430 | + JSON.stringify(value) | | 431 | + .replace(/^"|"$/g, '') | | 432 | + .replace(/'/g, "\\'") | | 433 | + .replace(/\\"/g, '"') + | | 434 | + '\''; | 432 | 435 | return ctx.stylize(simple, 'string'); | 433 | 436 | } | 434 | 437 | if (type === 'number') { | |
Collapse file Copy file name to clipboardExpand all lines: lib/zlib.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,8 +6,8 @@ const binding = process.binding('zlib'); | 6 | 6 | const util = require('util'); | 7 | 7 | const assert = require('assert').ok; | 8 | 8 | const kMaxLength = require('buffer').kMaxLength; | 9 | | -const kRangeErrorMessage = 'Cannot create final Buffer. ' + | 10 | | - 'It would be larger than 0x' + kMaxLength.toString(16) + ' bytes.'; | | 9 | +const kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' + | | 10 | + 'than 0x' + kMaxLength.toString(16) + ' bytes.'; | 11 | 11 |
| 12 | 12 | // zlib doesn't provide these, so kludge them in following the same | 13 | 13 | // const naming scheme zlib uses. | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-buffer.js +20-20Lines changed: 20 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -464,17 +464,17 @@ assert.equal('TWFu', (new Buffer('Man')).toString('base64')); | 464 | 464 | { | 465 | 465 | // big example | 466 | 466 | const quote = 'Man is distinguished, not only by his reason, but by this ' + | 467 | | - 'singular passion from other animals, which is a lust ' + | 468 | | - 'of the mind, that by a perseverance of delight in the ' + | 469 | | - 'continued and indefatigable generation of knowledge, exceeds ' + | 470 | | - 'the short vehemence of any carnal pleasure.'; | | 467 | + 'singular passion from other animals, which is a lust ' + | | 468 | + 'of the mind, that by a perseverance of delight in the ' + | | 469 | + 'continued and indefatigable generation of knowledge, ' + | | 470 | + 'exceeds the short vehemence of any carnal pleasure.'; | 471 | 471 | const expected = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb' + | 472 | | - '24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBh' + | 473 | | - 'bmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk' + | 474 | | - 'gYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIG' + | 475 | | - 'FuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBle' + | 476 | | - 'GNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVh' + | 477 | | - 'c3VyZS4='; | | 472 | + '24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlci' + | | 473 | + 'BhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQ' + | | 474 | + 'gYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu' + | | 475 | + 'dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZ' + | | 476 | + 'GdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm' + | | 477 | + '5hbCBwbGVhc3VyZS4='; | 478 | 478 | assert.equal(expected, (new Buffer(quote)).toString('base64')); | 479 | 479 |
| 480 | 480 | let b = new Buffer(1024); | @@ -484,11 +484,11 @@ assert.equal('TWFu', (new Buffer('Man')).toString('base64')); | 484 | 484 |
| 485 | 485 | // check that the base64 decoder ignores whitespace | 486 | 486 | const expectedWhite = expected.slice(0, 60) + ' \n' + | 487 | | - expected.slice(60, 120) + ' \n' + | 488 | | - expected.slice(120, 180) + ' \n' + | 489 | | - expected.slice(180, 240) + ' \n' + | 490 | | - expected.slice(240, 300) + '\n' + | 491 | | - expected.slice(300, 360) + '\n'; | | 487 | + expected.slice(60, 120) + ' \n' + | | 488 | + expected.slice(120, 180) + ' \n' + | | 489 | + expected.slice(180, 240) + ' \n' + | | 490 | + expected.slice(240, 300) + '\n' + | | 491 | + expected.slice(300, 360) + '\n'; | 492 | 492 | b = new Buffer(1024); | 493 | 493 | bytesWritten = b.write(expectedWhite, 0, 'base64'); | 494 | 494 | assert.equal(quote.length, bytesWritten); | @@ -502,11 +502,11 @@ assert.equal('TWFu', (new Buffer('Man')).toString('base64')); | 502 | 502 |
| 503 | 503 | // check that the base64 decoder ignores illegal chars | 504 | 504 | const expectedIllegal = expected.slice(0, 60) + ' \x80' + | 505 | | - expected.slice(60, 120) + ' \xff' + | 506 | | - expected.slice(120, 180) + ' \x00' + | 507 | | - expected.slice(180, 240) + ' \x98' + | 508 | | - expected.slice(240, 300) + '\x03' + | 509 | | - expected.slice(300, 360); | | 505 | + expected.slice(60, 120) + ' \xff' + | | 506 | + expected.slice(120, 180) + ' \x00' + | | 507 | + expected.slice(180, 240) + ' \x98' + | | 508 | + expected.slice(240, 300) + '\x03' + | | 509 | + expected.slice(300, 360); | 510 | 510 | b = new Buffer(expectedIllegal, 'base64'); | 511 | 511 | assert.equal(quote.length, b.length); | 512 | 512 | assert.equal(quote, b.toString('ascii', 0, quote.length)); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-cluster-worker-exit.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -107,7 +107,7 @@ function checkResults(expected_results, results) { | 107 | 107 | const expected = expected_results[k]; | 108 | 108 |
| 109 | 109 | var msg = (expected[1] || '') + | 110 | | - (' [expected: ' + expected[0] + ' / actual: ' + actual + ']'); | | 110 | + (' [expected: ' + expected[0] + ' / actual: ' + actual + ']'); | 111 | 111 |
| 112 | 112 | if (expected && expected.length) { | 113 | 113 | assert.equal(actual, expected[0], msg); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-cluster-worker-kill.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -90,7 +90,7 @@ function checkResults(expected_results, results) { | 90 | 90 | const expected = expected_results[k]; | 91 | 91 |
| 92 | 92 | var msg = (expected[1] || '') + | 93 | | - (' [expected: ' + expected[0] + ' / actual: ' + actual + ']'); | | 93 | + (' [expected: ' + expected[0] + ' / actual: ' + actual + ']'); | 94 | 94 | if (expected && expected.length) { | 95 | 95 | assert.equal(actual, expected[0], msg); | 96 | 96 | } else { | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-domain-no-error-handler-abort-on-uncaught.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -182,8 +182,8 @@ if (process.argv[2] === 'child') { | 182 | 182 |
| 183 | 183 | child.on('exit', function onExit(exitCode, signal) { | 184 | 184 | const errMsg = 'Test at index ' + testIndex + ' should have aborted ' + | 185 | | - 'but instead exited with exit code ' + exitCode + ' and signal ' + | 186 | | - signal; | | 185 | + 'but instead exited with exit code ' + exitCode + | | 186 | + ' and signal ' + signal; | 187 | 187 | assert(common.nodeProcessAborted(exitCode, signal), errMsg); | 188 | 188 | }); | 189 | 189 | }); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-error-reporting.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ var exits = 0; | 8 | 8 |
| 9 | 9 | function errExec(script, callback) { | 10 | 10 | var cmd = '"' + process.argv[0] + '" "' + | 11 | | - path.join(common.fixturesDir, script) + '"'; | | 11 | + path.join(common.fixturesDir, script) + '"'; | 12 | 12 | return exec(cmd, function(err, stdout, stderr) { | 13 | 13 | // There was some error | 14 | 14 | assert.ok(err); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-fs-append-file-sync.js +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -8,12 +8,12 @@ var currentFileData = 'ABCD'; | 8 | 8 |
| 9 | 9 | var num = 220; | 10 | 10 | var data = '南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、' + | 11 | | - '广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。' + | 12 | | - '南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。' + | 13 | | - '前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' + | 14 | | - '南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,' + | 15 | | - '历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,' + | 16 | | - '它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n'; | | 11 | + '广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。' + | | 12 | + '南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。' + | | 13 | + '前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' + | | 14 | + '南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,' + | | 15 | + '历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,' + | | 16 | + '它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n'; | 17 | 17 |
| 18 | 18 | common.refreshTmpDir(); | 19 | 19 |
| |
|