| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 574d061 commit 1eac1d7
49 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,5 +30,5 @@ const sub = require('./submodule'); | |||
| 30 | 30 | const mod = require(path.join(i, 'binding.node')); | |
| 31 | 31 | assert.notStrictEqual(mod, null); | |
| 32 | 32 | assert.strictEqual(mod.hello(), 'world'); | |
| 33 | - sub.test(i); | ||
| 33 | + sub.test(i); // Should not throw. | ||
| 34 | 34 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -579,11 +579,8 @@ process.on('exit', function() { | |||
| 579 | 579 | assert.ok(getaddrinfoCallbackCalled); | |
| 580 | 580 | }); | |
| 581 | 581 | ||
| 582 | - | ||
| 582 | + // Should not throw. | ||
| 583 | 583 | dns.lookup(addresses.INET6_HOST, 6, common.mustCall()); | |
| 584 | - | ||
| 585 | 584 | dns.lookup(addresses.INET_HOST, {}, common.mustCall()); | |
| 586 | - | ||
| 587 | 585 | dns.lookupService('0.0.0.0', '0', common.mustCall()); | |
| 588 | - | ||
| 589 | 586 | dns.lookupService('0.0.0.0', 0, common.mustCall()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -492,8 +492,8 @@ assertOnlyDeepEqual([1, , , 3], [1, , , 3, , , ]); | |||
| 492 | 492 | ||
| 493 | 493 | // Handle NaN | |
| 494 | 494 | assert.throws(() => { assert.deepEqual(NaN, NaN); }, assert.AssertionError); | |
| 495 | - { assert.deepStrictEqual(NaN, NaN); } | ||
| 496 | - { assert.deepStrictEqual({ a: NaN }, { a: NaN }); } | ||
| 495 | + assert.deepStrictEqual(NaN, NaN); | ||
| 496 | + assert.deepStrictEqual({ a: NaN }, { a: NaN }); | ||
| 497 | 497 | assert.deepStrictEqual([ 1, 2, NaN, 4 ], [ 1, 2, NaN, 4 ]); | |
| 498 | 498 | ||
| 499 | 499 | // Handle boxed primitives | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,7 +62,7 @@ assert.throws(() => b.write('test', 'utf8', 0), | |||
| 62 | 62 | /is no longer supported/); | |
| 63 | 63 | ||
| 64 | 64 | ||
| 65 | - // try to create 0-length buffers | ||
| 65 | + // Try to create 0-length buffers. Should not throw. | ||
| 66 | 66 | Buffer.from(''); | |
| 67 | 67 | Buffer.from('', 'ascii'); | |
| 68 | 68 | Buffer.from('', 'latin1'); | |
@@ -107,7 +107,7 @@ b.copy(Buffer.alloc(1), 0, 2048, 2048); | |||
| 107 | 107 | assert.strictEqual(writeTest.toString(), 'nodejs'); | |
| 108 | 108 | } | |
| 109 | 109 | ||
| 110 | - // Offset points to the end of the buffer | ||
| 110 | + // Offset points to the end of the buffer and does not throw. | ||
| 111 | 111 | // (see https://github.com/nodejs/node/issues/8127). | |
| 112 | 112 | Buffer.alloc(1).write('', 1, 0); | |
| 113 | 113 | ||
@@ -992,10 +992,10 @@ common.expectsError(() => { | |||
| 992 | 992 | assert.strictEqual(ubuf.buffer.byteLength, 10); | |
| 993 | 993 | } | |
| 994 | 994 | ||
| 995 | - // Regression test | ||
| 995 | + // Regression test to verify that an empty ArrayBuffer does not throw. | ||
| 996 | 996 | Buffer.from(new ArrayBuffer()); | |
| 997 | 997 | ||
| 998 | - // Test that ArrayBuffer from a different context is detected correctly | ||
| 998 | + // Test that ArrayBuffer from a different context is detected correctly. | ||
| 999 | 999 | const arrayBuf = vm.runInNewContext('new ArrayBuffer()'); | |
| 1000 | 1000 | Buffer.from(arrayBuf); | |
| 1001 | 1001 | Buffer.from({ buffer: arrayBuf }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | const common = require('../common'); | |
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | ||
| 5 | - Buffer.allocUnsafe(10); | ||
| 5 | + Buffer.allocUnsafe(10); // Should not throw. | ||
| 6 | 6 | ||
| 7 | 7 | const err = common.expectsError({ | |
| 8 | 8 | code: 'ERR_INVALID_ARG_TYPE', | |
@@ -14,4 +14,4 @@ assert.throws(function() { | |||
| 14 | 14 | Buffer.from(10, 'hex'); | |
| 15 | 15 | }, err); | |
| 16 | 16 | ||
| 17 | - Buffer.from('deadbeaf', 'hex'); | ||
| 17 | + Buffer.from('deadbeaf', 'hex'); // Should not throw. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ assert(MAX_STRING_LENGTH <= MAX_LENGTH); | |||
| 11 | 11 | assert.throws(() => ' '.repeat(MAX_STRING_LENGTH + 1), | |
| 12 | 12 | /^RangeError: Invalid string length$/); | |
| 13 | 13 | ||
| 14 | - ' '.repeat(MAX_STRING_LENGTH); | ||
| 14 | + ' '.repeat(MAX_STRING_LENGTH); // Should not throw. | ||
| 15 | 15 | ||
| 16 | 16 | // Legacy values match: | |
| 17 | 17 | assert.strictEqual(kMaxLength, MAX_LENGTH); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,7 +92,7 @@ const bb = Buffer.allocUnsafe(10); | |||
| 92 | 92 | bb.fill('hello crazy world'); | |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | - // try to copy from before the beginning of b | ||
| 95 | + // Try to copy from before the beginning of b. Should not throw. | ||
| 96 | 96 | b.copy(c, 0, 100, 10); | |
| 97 | 97 | ||
| 98 | 98 | // copy throws at negative sourceStart | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,8 +22,7 @@ arr2[1] = 6000; | |||
| 22 | 22 | ||
| 23 | 23 | assert.deepStrictEqual(arr_buf, ar_buf); | |
| 24 | 24 | ||
| 25 | - // Checks for calling Buffer.byteLength on a SharedArrayBuffer | ||
| 26 | - | ||
| 25 | + // Checks for calling Buffer.byteLength on a SharedArrayBuffer. | ||
| 27 | 26 | assert.strictEqual(Buffer.byteLength(sab), sab.byteLength); | |
| 28 | 27 | ||
| 29 | - Buffer.from({ buffer: sab }); | ||
| 28 | + Buffer.from({ buffer: sab }); // Should not throw. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -77,9 +77,8 @@ expectedSameBufs.forEach(([buf1, buf2]) => { | |||
| 77 | 77 | ||
| 78 | 78 | const utf16Buf = Buffer.from('0123456789', 'utf16le'); | |
| 79 | 79 | assert.deepStrictEqual(utf16Buf.slice(0, 6), Buffer.from('012', 'utf16le')); | |
| 80 | - // try to slice a zero length Buffer | ||
| 81 | - // see https://github.com/joyent/node/issues/5881 | ||
| 82 | - Buffer.alloc(0).slice(0, 1); | ||
| 80 | + // Try to slice a zero length Buffer. | ||
| 81 | + // See https://github.com/joyent/node/issues/5881 | ||
| 83 | 82 | assert.strictEqual(Buffer.alloc(0).slice(0, 1).length, 0); | |
| 84 | 83 | ||
| 85 | 84 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,13 +38,13 @@ assert.throws(function() { | |||
| 38 | 38 | child.on('error', common.mustNotCall()); | |
| 39 | 39 | }, TypeError); | |
| 40 | 40 | ||
| 41 | - // verify that valid argument combinations do not throw | ||
| 41 | + // Verify that valid argument combinations do not throw. | ||
| 42 | 42 | spawn(cmd); | |
| 43 | 43 | spawn(cmd, []); | |
| 44 | 44 | spawn(cmd, {}); | |
| 45 | 45 | spawn(cmd, [], {}); | |
| 46 | 46 | ||
| 47 | - // verify that invalid argument combinations throw | ||
| 47 | + // Verify that invalid argument combinations throw. | ||
| 48 | 48 | assert.throws(function() { | |
| 49 | 49 | spawn(); | |
| 50 | 50 | }, invalidFileMsg); | |
@@ -74,7 +74,7 @@ assert.throws(function() { | |||
| 74 | 74 | spawn(cmd, [], 1); | |
| 75 | 75 | }, invalidOptionsMsg); | |
| 76 | 76 | ||
| 77 | - // Argument types for combinatorics | ||
| 77 | + // Argument types for combinatorics. | ||
| 78 | 78 | const a = []; | |
| 79 | 79 | const o = {}; | |
| 80 | 80 | function c() {} | |
@@ -92,7 +92,7 @@ spawn(cmd, a); | |||
| 92 | 92 | spawn(cmd, a, o); | |
| 93 | 93 | spawn(cmd, o); | |
| 94 | 94 | ||
| 95 | - // Variants of undefined as explicit 'no argument' at a position | ||
| 95 | + // Variants of undefined as explicit 'no argument' at a position. | ||
| 96 | 96 | spawn(cmd, u, o); | |
| 97 | 97 | spawn(cmd, a, u); | |
| 98 | 98 | ||
@@ -103,7 +103,7 @@ assert.throws(function() { spawn(cmd, s); }, TypeError); | |||
| 103 | 103 | assert.throws(function() { spawn(cmd, a, s); }, TypeError); | |
| 104 | 104 | ||
| 105 | 105 | ||
| 106 | - // verify that execFile has same argument parsing behavior as spawn | ||
| 106 | + // Verify that execFile has same argument parsing behavior as spawn. | ||
| 107 | 107 | // | |
| 108 | 108 | // function execFile(file=f [,args=a] [, options=o] [, callback=c]) has valid | |
| 109 | 109 | // combinations: | |
@@ -124,7 +124,7 @@ execFile(cmd, o); | |||
| 124 | 124 | execFile(cmd, o, c); | |
| 125 | 125 | execFile(cmd, c); | |
| 126 | 126 | ||
| 127 | - // Variants of undefined as explicit 'no argument' at a position | ||
| 127 | + // Variants of undefined as explicit 'no argument' at a position. | ||
| 128 | 128 | execFile(cmd, u, o, c); | |
| 129 | 129 | execFile(cmd, a, u, c); | |
| 130 | 130 | execFile(cmd, a, o, u); | |
@@ -146,7 +146,7 @@ execFile(cmd, o, n); | |||
| 146 | 146 | execFile(cmd, c, u); | |
| 147 | 147 | execFile(cmd, c, n); | |
| 148 | 148 | ||
| 149 | - // string is invalid in arg position (this may seem strange, but is | ||
| 149 | + // String is invalid in arg position (this may seem strange, but is | ||
| 150 | 150 | // consistent across node API, cf. `net.createServer('not options', 'not | |
| 151 | 151 | // callback')` | |
| 152 | 152 | assert.throws(function() { execFile(cmd, s, o, c); }, TypeError); | |
@@ -160,10 +160,9 @@ assert.throws(function() { execFile(cmd, a, u, s); }, TypeError); | |||
| 160 | 160 | assert.throws(function() { execFile(cmd, a, n, s); }, TypeError); | |
| 161 | 161 | assert.throws(function() { execFile(cmd, u, o, s); }, TypeError); | |
| 162 | 162 | assert.throws(function() { execFile(cmd, n, o, s); }, TypeError); | |
| 163 | - execFile(cmd, c, s); | ||
| 163 | + execFile(cmd, c, s); // Should not throw. | ||
| 164 | 164 | ||
| 165 | - | ||
| 166 | - // verify that fork has same argument parsing behavior as spawn | ||
| 165 | + // Verify that fork has same argument parsing behavior as spawn. | ||
| 167 | 166 | // | |
| 168 | 167 | // function fork(file=f [,args=a] [, options=o]) has valid combinations: | |
| 169 | 168 | // (f) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments