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 {
151151const assert = require ( 'internal/assert' ) ;
152152
153153const { BuiltinModule } = require ( 'internal/bootstrap/realm' ) ;
154+ const { SymbolToPrimitive } = primordials ;
154155const {
155156 validateObject,
156157 validateString,
@@ -2204,6 +2205,10 @@ function formatWithOptionsInternal(inspectOptions, args) {
22042205 tempArg === null ||
22052206 ! hasBuiltInToString ( tempArg ) ) {
22062207 tempStr = String ( tempArg ) ;
2208+ } else if ( hasBuiltInToString ( tempArg ) &&
2209+ getProxyDetails ( tempArg , false ) === undefined &&
2210+ tempArg [ SymbolToPrimitive ] !== undefined ) {
2211+ tempStr = tempArg [ SymbolToPrimitive ] ( 'string' ) ;
22072212 } else {
22082213 tempStr = inspect ( tempArg , {
22092214 ...inspectOptions ,
You can’t perform that action at this time.
0 commit comments