File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ const {
151
151
const assert = require ( 'internal/assert' ) ;
152
152
153
153
const { BuiltinModule } = require ( 'internal/bootstrap/realm' ) ;
154
+ const { SymbolToPrimitive } = primordials ;
154
155
const {
155
156
validateObject,
156
157
validateString,
@@ -2204,6 +2205,10 @@ function formatWithOptionsInternal(inspectOptions, args) {
2204
2205
tempArg === null ||
2205
2206
! hasBuiltInToString ( tempArg ) ) {
2206
2207
tempStr = String ( tempArg ) ;
2208
+ } else if ( hasBuiltInToString ( tempArg ) &&
2209
+ getProxyDetails ( tempArg , false ) === undefined &&
2210
+ tempArg [ SymbolToPrimitive ] !== undefined ) {
2211
+ tempStr = tempArg [ SymbolToPrimitive ] ( 'string' ) ;
2207
2212
} else {
2208
2213
tempStr = inspect ( tempArg , {
2209
2214
...inspectOptions ,
You can’t perform that action at this time.
0 commit comments