File tree 3 files changed +36
-1
lines changed
3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ const common = require ( '../common' ) ;
4
+ const {
5
+ codes : {
6
+ ERR_INVALID_STATE ,
7
+ }
8
+ } = require ( 'internal/errors' ) ;
9
+
10
+ const bench = common . createBenchmark ( main , {
11
+ n : [ 1e7 ] ,
12
+ } , {
13
+ flags : [ '--expose-internals' ]
14
+ } ) ;
15
+
16
+ function main ( { n } ) {
17
+ bench . start ( ) ;
18
+ for ( let i = 0 ; i < n ; ++ i )
19
+ new ERR_INVALID_STATE . TypeError ( 'test' ) ;
20
+ bench . end ( n ) ;
21
+ }
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ const {
48
48
codes : {
49
49
ERR_FALSY_VALUE_REJECTION ,
50
50
ERR_INVALID_ARG_TYPE ,
51
- ERR_OUT_OF_RANGE
51
+ ERR_OUT_OF_RANGE ,
52
52
} ,
53
53
errnoException,
54
54
exceptionWithHostPort,
You can’t perform that action at this time.
0 commit comments