We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b415e8 commit f5ece4aCopy full SHA for f5ece4a
benchmark/error/error.js
@@ -0,0 +1,14 @@
1
+'use strict';
2
+
3
+const common = require('../common.js');
4
5
+const bench = common.createBenchmark(main, {
6
+ n: [1e7],
7
+});
8
9
+function main({ n }) {
10
+ bench.start();
11
+ for (let i = 0; i < n; ++i)
12
+ new Error('test');
13
+ bench.end(n);
14
+}
benchmark/error/node-error.js
@@ -0,0 +1,21 @@
+const common = require('../common');
+const {
+ codes: {
+ ERR_INVALID_STATE,
+ }
+} = require('internal/errors');
+}, {
+ flags: ['--expose-internals']
15
16
17
18
19
+ new ERR_INVALID_STATE.TypeError('test');
20
21
0 commit comments