@@ -93,7 +93,7 @@ assert.strictEqual(
9393 Object . assign ( new String ( 'hello' ) , { [ Symbol ( 'foo' ) ] : 123 } ) ,
9494 { showHidden : true }
9595 ) ,
96- ' { [String: \ 'hello\ '] [length]: 5, [Symbol(foo)]: 123 }'
96+ " { [String: 'hello'] [length]: 5, [Symbol(foo)]: 123 }"
9797) ;
9898
9999assert . strictEqual ( util . inspect ( ( new JSStream ( ) ) . _externalStream ) ,
@@ -265,7 +265,7 @@ assert.strictEqual(
265265 name : { value : 'Tim' , enumerable : true } ,
266266 hidden : { value : 'secret' }
267267 } ) ) ,
268- ' { name: \ 'Tim\ ' }'
268+ " { name: 'Tim' }"
269269) ;
270270
271271// Dynamic properties.
@@ -308,7 +308,7 @@ assert.strictEqual(
308308 }
309309 ) ;
310310 assert . strictEqual ( util . inspect ( value ) ,
311- ' [ 1, 2, 3, growingLength: [Getter], \ '-1\ ': -1 ]' ) ;
311+ " [ 1, 2, 3, growingLength: [Getter], '-1': -1 ]" ) ;
312312}
313313
314314// Array with inherited number properties.
@@ -422,24 +422,24 @@ assert.strictEqual(util.inspect(-5e-324), '-5e-324');
422422// Test for sparse array.
423423{
424424 const a = [ 'foo' , 'bar' , 'baz' ] ;
425- assert . strictEqual ( util . inspect ( a ) , '[ \ 'foo\ ', \ 'bar\ ', \ 'baz\ ' ]' ) ;
425+ assert . strictEqual ( util . inspect ( a ) , "[ 'foo', 'bar', 'baz' ]" ) ;
426426 delete a [ 1 ] ;
427- assert . strictEqual ( util . inspect ( a ) , '[ \ 'foo\ ', <1 empty item>, \ 'baz\ ' ]' ) ;
427+ assert . strictEqual ( util . inspect ( a ) , "[ 'foo', <1 empty item>, 'baz' ]" ) ;
428428 assert . strictEqual (
429429 util . inspect ( a , true ) ,
430- '[ \ 'foo\ ', <1 empty item>, \ 'baz\ ', [length]: 3 ]'
430+ "[ 'foo', <1 empty item>, 'baz', [length]: 3 ]"
431431 ) ;
432432 assert . strictEqual ( util . inspect ( new Array ( 5 ) ) , '[ <5 empty items> ]' ) ;
433433 a [ 3 ] = 'bar' ;
434434 a [ 100 ] = 'qux' ;
435435 assert . strictEqual (
436436 util . inspect ( a , { breakLength : Infinity } ) ,
437- '[ \ 'foo\ ', <1 empty item>, \ 'baz\ ', \ 'bar\ ', <96 empty items>, \ 'qux\ ' ]'
437+ "[ 'foo', <1 empty item>, 'baz', 'bar', <96 empty items>, 'qux' ]"
438438 ) ;
439439 delete a [ 3 ] ;
440440 assert . strictEqual (
441441 util . inspect ( a , { maxArrayLength : 4 } ) ,
442- '[ \ 'foo\ ', <1 empty item>, \ 'baz\ ', <97 empty items>, ... 1 more item ]'
442+ "[ 'foo', <1 empty item>, 'baz', <97 empty items>, ... 1 more item ]"
443443 ) ;
444444}
445445
@@ -630,13 +630,13 @@ assert.strictEqual(util.inspect(Object.create(Date.prototype)), 'Date {}');
630630
631631 assert . strictEqual (
632632 util . inspect ( w ) ,
633- '{ \ '\\\\\ ': 1, \ '\\\\\\\\\ ': 2, \ '\\\\\\\\\\\\\ ': 3, ' +
634- '\' \\\\\\\\\\\\\\\\\ ': 4, \ '\\n\ ': 5, \ '\\r\ ': 6 }'
633+ "{ '\\\\': 1, '\\\\\\\\': 2, '\\\\\\\\\\\\': 3, " +
634+ "'\ \\\\\\\\\\\\\\\': 4, '\\n': 5, '\\r': 6 }"
635635 ) ;
636636 assert . strictEqual (
637637 util . inspect ( y ) ,
638- '[ \'a\ ', \'b\ ', \'c\ ', \ '\\\\\\\\\ ': \'d\ ', ' +
639- '\'\\n\ ': \'e\ ', \ '\\r\ ': \'f\ ' ]'
638+ "[ 'a ', 'b ', 'c ', '\\\\\\\\': 'd ', " +
639+ "'\\n ': 'e ', '\\r': 'f ' ]"
640640 ) ;
641641}
642642
@@ -733,7 +733,7 @@ util.inspect({ hasOwnProperty: null });
733733 // A custom [util.inspect.custom]() should be able to return other Objects.
734734 subject [ util . inspect . custom ] = ( ) => ( { foo : 'bar' } ) ;
735735
736- assert . strictEqual ( util . inspect ( subject ) , ' { foo: \ 'bar\ ' }' ) ;
736+ assert . strictEqual ( util . inspect ( subject ) , " { foo: 'bar' }" ) ;
737737
738738 subject [ util . inspect . custom ] = ( depth , opts ) => {
739739 assert . strictEqual ( opts . customInspectOptions , true ) ;
@@ -776,7 +776,7 @@ util.inspect({ hasOwnProperty: null });
776776}
777777
778778// Test boxed primitives output the correct values.
779- assert . strictEqual ( util . inspect ( new String ( 'test' ) ) , ' [String: \ 'test\']' ) ;
779+ assert . strictEqual ( util . inspect ( new String ( 'test' ) ) , " [String: 'test']" ) ;
780780assert . strictEqual (
781781 util . inspect ( Object ( Symbol ( 'test' ) ) ) ,
782782 '[Symbol: Symbol(test)]'
@@ -792,15 +792,15 @@ assert.strictEqual(util.inspect(new Number(13.37)), '[Number: 13.37]');
792792{
793793 const str = new String ( 'baz' ) ;
794794 str . foo = 'bar' ;
795- assert . strictEqual ( util . inspect ( str ) , ' { [String: \ 'baz\ '] foo: \ 'bar\ ' }' ) ;
795+ assert . strictEqual ( util . inspect ( str ) , " { [String: 'baz'] foo: 'bar' }" ) ;
796796
797797 const bool = new Boolean ( true ) ;
798798 bool . foo = 'bar' ;
799- assert . strictEqual ( util . inspect ( bool ) , ' { [Boolean: true] foo: \ 'bar\ ' }' ) ;
799+ assert . strictEqual ( util . inspect ( bool ) , " { [Boolean: true] foo: 'bar' }" ) ;
800800
801801 const num = new Number ( 13.37 ) ;
802802 num . foo = 'bar' ;
803- assert . strictEqual ( util . inspect ( num ) , ' { [Number: 13.37] foo: \ 'bar\ ' }' ) ;
803+ assert . strictEqual ( util . inspect ( num ) , " { [Number: 13.37] foo: 'bar' }" ) ;
804804}
805805
806806// Test es6 Symbol.
@@ -829,7 +829,7 @@ if (typeof Symbol !== 'undefined') {
829829 assert . strictEqual ( util . inspect ( subject ) , '{ [Symbol(symbol)]: 42 }' ) ;
830830 assert . strictEqual (
831831 util . inspect ( subject , options ) ,
832- ' { [Symbol(symbol)]: 42, [Symbol()]: \ 'non-enum\ ' }'
832+ " { [Symbol(symbol)]: 42, [Symbol()]: 'non-enum' }"
833833 ) ;
834834
835835 subject = [ 1 , 2 , 3 ] ;
@@ -847,7 +847,7 @@ if (typeof Symbol !== 'undefined') {
847847 set . bar = 42 ;
848848 assert . strictEqual (
849849 util . inspect ( set , true ) ,
850- ' Set { \ 'foo\ ', [size]: 1, bar: 42 }'
850+ " Set { 'foo', [size]: 1, bar: 42 }"
851851 ) ;
852852}
853853
@@ -862,11 +862,11 @@ if (typeof Symbol !== 'undefined') {
862862{
863863 assert . strictEqual ( util . inspect ( new Map ( ) ) , 'Map {}' ) ;
864864 assert . strictEqual ( util . inspect ( new Map ( [ [ 1 , 'a' ] , [ 2 , 'b' ] , [ 3 , 'c' ] ] ) ) ,
865- ' Map { 1 => \'a\ ', 2 => \'b\ ', 3 => \'c\ ' }' ) ;
865+ " Map { 1 => 'a ', 2 => 'b ', 3 => 'c ' }" ) ;
866866 const map = new Map ( [ [ 'foo' , null ] ] ) ;
867867 map . bar = 42 ;
868868 assert . strictEqual ( util . inspect ( map , true ) ,
869- ' Map { \ 'foo\ ' => null, [size]: 1, bar: 42 }' ) ;
869+ " Map { 'foo' => null, [size]: 1, bar: 42 }" ) ;
870870}
871871
872872// Test circular Map.
@@ -897,7 +897,7 @@ if (typeof Symbol !== 'undefined') {
897897 const promiseWithProperty = Promise . resolve ( 'foo' ) ;
898898 promiseWithProperty . bar = 42 ;
899899 assert . strictEqual ( util . inspect ( promiseWithProperty ) ,
900- ' Promise { \ 'foo\ ', bar: 42 }' ) ;
900+ " Promise { 'foo', bar: 42 }" ) ;
901901}
902902
903903// Make sure it doesn't choke on polyfills. Unlike Set/Map, there is no standard
@@ -913,14 +913,14 @@ if (typeof Symbol !== 'undefined') {
913913// Test Map iterators.
914914{
915915 const map = new Map ( [ [ 'foo' , 'bar' ] ] ) ;
916- assert . strictEqual ( util . inspect ( map . keys ( ) ) , ' [Map Iterator] { \ 'foo\ ' }' ) ;
917- assert . strictEqual ( util . inspect ( map . values ( ) ) , ' [Map Iterator] { \ 'bar\ ' }' ) ;
916+ assert . strictEqual ( util . inspect ( map . keys ( ) ) , " [Map Iterator] { 'foo' }" ) ;
917+ assert . strictEqual ( util . inspect ( map . values ( ) ) , " [Map Iterator] { 'bar' }" ) ;
918918 assert . strictEqual ( util . inspect ( map . entries ( ) ) ,
919- ' [Map Iterator] { [ \ 'foo\ ', \ 'bar\ ' ] }' ) ;
919+ " [Map Iterator] { [ 'foo', 'bar' ] }" ) ;
920920 // Make sure the iterator doesn't get consumed.
921921 const keys = map . keys ( ) ;
922- assert . strictEqual ( util . inspect ( keys ) , ' [Map Iterator] { \ 'foo\ ' }' ) ;
923- assert . strictEqual ( util . inspect ( keys ) , ' [Map Iterator] { \ 'foo\ ' }' ) ;
922+ assert . strictEqual ( util . inspect ( keys ) , " [Map Iterator] { 'foo' }" ) ;
923+ assert . strictEqual ( util . inspect ( keys ) , " [Map Iterator] { 'foo' }" ) ;
924924 keys . extra = true ;
925925 assert . strictEqual (
926926 util . inspect ( keys , { maxArrayLength : 0 } ) ,
@@ -995,7 +995,7 @@ if (typeof Symbol !== 'undefined') {
995995 assert . strictEqual ( util . inspect ( new SetSubclass ( [ 1 , 2 , 3 ] ) ) ,
996996 'SetSubclass [Set] { 1, 2, 3 }' ) ;
997997 assert . strictEqual ( util . inspect ( new MapSubclass ( [ [ 'foo' , 42 ] ] ) ) ,
998- ' MapSubclass [Map] { \ 'foo\ ' => 42 }' ) ;
998+ " MapSubclass [Map] { 'foo' => 42 }" ) ;
999999 assert . strictEqual ( util . inspect ( new PromiseSubclass ( ( ) => { } ) ) ,
10001000 'PromiseSubclass [Promise] { <pending> }' ) ;
10011001 assert . strictEqual (
@@ -1048,7 +1048,7 @@ if (typeof Symbol !== 'undefined') {
10481048{
10491049 const x = [ ] ;
10501050 x [ '' ] = 1 ;
1051- assert . strictEqual ( util . inspect ( x ) , '[ \'\ ': 1 ]' ) ;
1051+ assert . strictEqual ( util . inspect ( x ) , "[ ' ': 1 ]" ) ;
10521052}
10531053
10541054// The following maxArrayLength tests were introduced after v6.0.0 was released.
@@ -1094,10 +1094,10 @@ if (typeof Symbol !== 'undefined') {
10941094 const breakpoint = oneLine . length - 5 ;
10951095 const twoLines = util . inspect ( obj , { breakLength : breakpoint } ) ;
10961096
1097- assert . strictEqual ( oneLine , ' { foo: \ 'abc\ ', bar: \ 'xyz\ ' }' ) ;
1097+ assert . strictEqual ( oneLine , " { foo: 'abc', bar: 'xyz' }" ) ;
10981098 assert . strictEqual ( oneLine ,
10991099 util . inspect ( obj , { breakLength : breakpoint + 1 } ) ) ;
1100- assert . strictEqual ( twoLines , ' { foo: \ 'abc\ ',\n bar: \ 'xyz\ ' }' ) ;
1100+ assert . strictEqual ( twoLines , " { foo: 'abc',\n bar: 'xyz' }" ) ;
11011101}
11021102
11031103// util.inspect.defaultOptions tests.
@@ -1168,7 +1168,7 @@ util.inspect(process);
11681168{
11691169 // @@toStringTag
11701170 assert . strictEqual ( util . inspect ( { [ Symbol . toStringTag ] : 'a' } ) ,
1171- ' Object [a] { [Symbol(Symbol.toStringTag)]: \'a\ ' }' ) ;
1171+ " Object [a] { [Symbol(Symbol.toStringTag)]: 'a ' }" ) ;
11721172
11731173 class Foo {
11741174 constructor ( ) {
@@ -1184,17 +1184,17 @@ util.inspect(process);
11841184 Object . create ( null , { [ Symbol . toStringTag ] : { value : 'foo' } } ) ) ,
11851185 '[foo] {}' ) ;
11861186
1187- assert . strictEqual ( util . inspect ( new Foo ( ) ) , ' Foo [bar] { foo: \ 'bar\ ' }' ) ;
1187+ assert . strictEqual ( util . inspect ( new Foo ( ) ) , " Foo [bar] { foo: 'bar' }" ) ;
11881188
11891189 assert . strictEqual (
11901190 util . inspect ( new ( class extends Foo { } ) ( ) ) ,
1191- ' Foo [bar] { foo: \ 'bar\ ' }' ) ;
1191+ " Foo [bar] { foo: 'bar' }" ) ;
11921192
11931193 assert . strictEqual (
11941194 util . inspect ( Object . create ( Object . create ( Foo . prototype ) , {
11951195 foo : { value : 'bar' , enumerable : true }
11961196 } ) ) ,
1197- ' Foo [bar] { foo: \ 'bar\ ' }' ) ;
1197+ " Foo [bar] { foo: 'bar' }" ) ;
11981198
11991199 class ThrowingClass {
12001200 get [ Symbol . toStringTag ] ( ) {
@@ -1246,69 +1246,69 @@ util.inspect(process);
12461246 ' 2,' ,
12471247 ' [' ,
12481248 ' [' ,
1249- ' \ 'Lorem ipsum dolor\\nsit amet,\\tconsectetur \ ' +' ,
1250- ' \ 'adipiscing elit, sed do eiusmod tempor \ ' +' ,
1251- ' \ 'incididunt ut labore et dolore magna \ ' +' ,
1252- ' \ 'aliqua.\',' ,
1253- ' \ 'test\',' ,
1254- ' \ 'foo\'' ,
1249+ " 'Lorem ipsum dolor\\nsit amet,\\tconsectetur ' +" ,
1250+ " 'adipiscing elit, sed do eiusmod tempor ' +" ,
1251+ " 'incididunt ut labore et dolore magna ' +" ,
1252+ " 'aliqua.'," ,
1253+ " 'test'," ,
1254+ " 'foo'" ,
12551255 ' ]' ,
12561256 ' ],' ,
12571257 ' 4' ,
12581258 ' ],' ,
12591259 ' b: Map {' ,
1260- ' \ 'za\ ' => 1,' ,
1261- ' \ 'zb\ ' => \ 'test\'' ,
1260+ " 'za' => 1," ,
1261+ " 'zb' => 'test'" ,
12621262 ' }' ,
12631263 '}'
12641264 ] . join ( '\n' ) ;
12651265 assert . strictEqual ( out , expect ) ;
12661266
12671267 out = util . inspect ( o . a [ 2 ] [ 0 ] [ 0 ] , { compact : false , breakLength : 30 } ) ;
12681268 expect = [
1269- '\' Lorem ipsum dolor\\nsit \ ' +' ,
1270- ' \ 'amet,\\tconsectetur \ ' +' ,
1271- ' \ 'adipiscing elit, sed do \ ' +' ,
1272- ' \ 'eiusmod tempor incididunt \ ' +' ,
1273- ' \ 'ut labore et dolore magna \ ' +' ,
1274- ' \ 'aliqua.\''
1269+ "' Lorem ipsum dolor\\nsit ' +" ,
1270+ " 'amet,\\tconsectetur ' +" ,
1271+ " 'adipiscing elit, sed do ' +" ,
1272+ " 'eiusmod tempor incididunt ' +" ,
1273+ " 'ut labore et dolore magna ' +" ,
1274+ " 'aliqua.'"
12751275 ] . join ( '\n' ) ;
12761276 assert . strictEqual ( out , expect ) ;
12771277
12781278 out = util . inspect (
12791279 '12345678901234567890123456789012345678901234567890' ,
12801280 { compact : false , breakLength : 3 } ) ;
1281- expect = '\' 12345678901234567890123456789012345678901234567890\'' ;
1281+ expect = "' 12345678901234567890123456789012345678901234567890'" ;
12821282 assert . strictEqual ( out , expect ) ;
12831283
12841284 out = util . inspect (
12851285 '12 45 78 01 34 67 90 23 56 89 123456789012345678901234567890' ,
12861286 { compact : false , breakLength : 3 } ) ;
12871287 expect = [
1288- '\' 12 45 78 01 34 \ ' +' ,
1289- ' \ '67 90 23 56 89 \ ' +' ,
1290- ' \ '123456789012345678901234567890\''
1288+ "' 12 45 78 01 34 ' +" ,
1289+ " '67 90 23 56 89 ' +" ,
1290+ " '123456789012345678901234567890'"
12911291 ] . join ( '\n' ) ;
12921292 assert . strictEqual ( out , expect ) ;
12931293
12941294 out = util . inspect (
12951295 '12 45 78 01 34 67 90 23 56 89 1234567890123 0' ,
12961296 { compact : false , breakLength : 3 } ) ;
12971297 expect = [
1298- '\' 12 45 78 01 34 \ ' +' ,
1299- ' \ '67 90 23 56 89 \ ' +' ,
1300- ' \ '1234567890123 0\''
1298+ "' 12 45 78 01 34 ' +" ,
1299+ " '67 90 23 56 89 ' +" ,
1300+ " '1234567890123 0'"
13011301 ] . join ( '\n' ) ;
13021302 assert . strictEqual ( out , expect ) ;
13031303
13041304 out = util . inspect (
13051305 '12 45 78 01 34 67 90 23 56 89 12345678901234567 0' ,
13061306 { compact : false , breakLength : 3 } ) ;
13071307 expect = [
1308- '\' 12 45 78 01 34 \ ' +' ,
1309- ' \ '67 90 23 56 89 \ ' +' ,
1310- ' \ '12345678901234567 \ ' +' ,
1311- ' \'0\''
1308+ "' 12 45 78 01 34 ' +" ,
1309+ " '67 90 23 56 89 ' +" ,
1310+ " '12345678901234567 ' +" ,
1311+ " '0'"
13121312 ] . join ( '\n' ) ;
13131313 assert . strictEqual ( out , expect ) ;
13141314
@@ -1347,7 +1347,7 @@ util.inspect(process);
13471347
13481348 o [ util . inspect . custom ] = ( ) => ( { a : '12 45 78 01 34 67 90 23' } ) ;
13491349 out = util . inspect ( o , { compact : false , breakLength : 3 } ) ;
1350- expect = ' {\n a: \ '12 45 78 01 34 \ ' +\n \ '67 90 23\ '\n}' ;
1350+ expect = " {\n a: '12 45 78 01 34 ' +\n '67 90 23'\n}" ;
13511351 assert . strictEqual ( out , expect ) ;
13521352}
13531353
0 commit comments