GeezerVison is showing github.com — benchmark: throw on invalid type in fs and webstorage · nodejs/node@b6567ea
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: benchmark/fs/bench-accessSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -48,7 +48,7 @@ function main({ n, type, method }) { | 48 | 48 | path = tmpdir.resolve(`.non-existing-file-${process.pid}`); | 49 | 49 | break; | 50 | 50 | default: | 51 | | - new Error('Invalid type'); | | 51 | + throw new Error('Invalid type'); | 52 | 52 | } | 53 | 53 |
| 54 | 54 | if (method === 'access') { | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-chmodSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,6 +36,6 @@ function main({ n, type }) { | 36 | 36 | bench.end(n); | 37 | 37 | break; | 38 | 38 | default: | 39 | | - new Error('Invalid type'); | | 39 | + throw new Error('Invalid type'); | 40 | 40 | } | 41 | 41 | } |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-chownSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -49,6 +49,6 @@ function main({ n, type, method }) { | 49 | 49 | break; | 50 | 50 | } | 51 | 51 | default: | 52 | | - new Error('Invalid type'); | | 52 | + throw new Error('Invalid type'); | 53 | 53 | } | 54 | 54 | } |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-existsSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ function main({ n, type }) { | 27 | 27 | path = tmpdir.resolve(`.non-existing-file-${process.pid}`); | 28 | 28 | break; | 29 | 29 | default: | 30 | | - new Error('Invalid type'); | | 30 | + throw new Error('Invalid type'); | 31 | 31 | } | 32 | 32 |
| 33 | 33 | bench.start(); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-fchmodSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -28,7 +28,7 @@ function main({ n, type }) { | 28 | 28 | files = new Array(n).fill(tmpdir.resolve(`.non-existing-file-${Date.now()}`)); | 29 | 29 | break; | 30 | 30 | default: | 31 | | - new Error('Invalid type'); | | 31 | + throw new Error('Invalid type'); | 32 | 32 | } | 33 | 33 |
| 34 | 34 | const fds = files.map((x) => { | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-fsyncSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -24,7 +24,7 @@ function main({ n, type }) { | 24 | 24 | fd = 1 << 30; | 25 | 25 | break; | 26 | 26 | default: | 27 | | - new Error('Invalid type'); | | 27 | + throw new Error('Invalid type'); | 28 | 28 | } | 29 | 29 |
| 30 | 30 | bench.start(); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-linkSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -45,6 +45,6 @@ function main({ n, type }) { | 45 | 45 | break; | 46 | 46 | } | 47 | 47 | default: | 48 | | - new Error('Invalid type'); | | 48 | + throw new Error('Invalid type'); | 49 | 49 | } | 50 | 50 | } |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-mkdirSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,7 @@ function main({ n, type, recursive }) { | 29 | 29 | files = new Array(n).fill(__dirname); | 30 | 30 | break; | 31 | 31 | default: | 32 | | - new Error('Invalid type'); | | 32 | + throw new Error('Invalid type'); | 33 | 33 | } | 34 | 34 |
| 35 | 35 | bench.start(); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-mkdtempSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ function main({ n, type }) { | 27 | 27 | prefix = tmpdir.resolve('non-existent', 'foo', 'bar'); | 28 | 28 | break; | 29 | 29 | default: | 30 | | - new Error('Invalid type'); | | 30 | + throw new Error('Invalid type'); | 31 | 31 | } | 32 | 32 |
| 33 | 33 | bench.start(); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/fs/bench-openSync.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -33,7 +33,7 @@ function main({ n, type }) { | 33 | 33 | path = tmpdir.resolve(`.non-existing-file-${process.pid}`); | 34 | 34 | break; | 35 | 35 | default: | 36 | | - new Error('Invalid type'); | | 36 | + throw new Error('Invalid type'); | 37 | 37 | } | 38 | 38 |
| 39 | 39 | runBench({ n, path }); | |
|