@@ -8,6 +8,7 @@ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'f
8
8
var setForEach = hasSet && Set . prototype . forEach ;
9
9
var booleanValueOf = Boolean . prototype . valueOf ;
10
10
var objectToString = Object . prototype . toString ;
11
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt . prototype . valueOf : null ;
11
12
12
13
var inspectCustom = require ( './util.inspect' ) . custom ;
13
14
var inspectSymbol = ( inspectCustom && isSymbol ( inspectCustom ) ) ? inspectCustom : null ;
@@ -113,6 +114,9 @@ module.exports = function inspect_ (obj, opts, depth, seen) {
113
114
if ( isNumber ( obj ) ) {
114
115
return markBoxed ( inspect ( Number ( obj ) ) ) ;
115
116
}
117
+ if ( isBigInt ( obj ) ) {
118
+ return markBoxed ( inspect ( bigIntValueOf . call ( obj ) ) ) ;
119
+ }
116
120
if ( isBoolean ( obj ) ) {
117
121
return markBoxed ( booleanValueOf . call ( obj ) ) ;
118
122
}
@@ -136,14 +140,15 @@ function quote (s) {
136
140
return String ( s ) . replace ( / " / g, '"' ) ;
137
141
}
138
142
139
- function isArray ( obj ) { return toStr ( obj ) === '[object Array]' }
140
- function isDate ( obj ) { return toStr ( obj ) === '[object Date]' }
141
- function isRegExp ( obj ) { return toStr ( obj ) === '[object RegExp]' }
142
- function isError ( obj ) { return toStr ( obj ) === '[object Error]' }
143
- function isSymbol ( obj ) { return toStr ( obj ) === '[object Symbol]' }
144
- function isString ( obj ) { return toStr ( obj ) === '[object String]' }
145
- function isNumber ( obj ) { return toStr ( obj ) === '[object Number]' }
146
- function isBoolean ( obj ) { return toStr ( obj ) === '[object Boolean]' }
143
+ function isArray ( obj ) { return toStr ( obj ) === '[object Array]' ; }
144
+ function isDate ( obj ) { return toStr ( obj ) === '[object Date]' ; }
145
+ function isRegExp ( obj ) { return toStr ( obj ) === '[object RegExp]' ; }
146
+ function isError ( obj ) { return toStr ( obj ) === '[object Error]' ; }
147
+ function isSymbol ( obj ) { return toStr ( obj ) === '[object Symbol]' ; }
148
+ function isString ( obj ) { return toStr ( obj ) === '[object String]' ; }
149
+ function isNumber ( obj ) { return toStr ( obj ) === '[object Number]' ; }
150
+ function isBigInt ( obj ) { return toStr ( obj ) === '[object BigInt]' ; }
151
+ function isBoolean ( obj ) { return toStr ( obj ) === '[object Boolean]' ; }
147
152
148
153
var hasOwn = Object . prototype . hasOwnProperty || function ( key ) { return key in this ; } ;
149
154
function has ( obj , key ) {
0 commit comments