@@ -2213,4 +2213,94 @@ assert.strictEqual(
2213
2213
'\u001b[33m3\u001b[39m, \u001b[33m4\u001b[39m ]' ;
2214
2214
2215
2215
assert . strictEqual ( out , expected ) ;
2216
+
2217
+ obj = [
2218
+ 'Object' , 'Function' , 'Array' ,
2219
+ 'Number' , 'parseFloat' , 'parseInt' ,
2220
+ 'Infinity' , 'NaN' , 'undefined' ,
2221
+ 'Boolean' , 'String' , 'Symbol' ,
2222
+ 'Date' , 'Promise' , 'RegExp' ,
2223
+ 'Error' , 'EvalError' , 'RangeError' ,
2224
+ 'ReferenceError' , 'SyntaxError' , 'TypeError' ,
2225
+ 'URIError' , 'JSON' , 'Math' ,
2226
+ 'console' , 'Intl' , 'ArrayBuffer' ,
2227
+ 'Uint8Array' , 'Int8Array' , 'Uint16Array' ,
2228
+ 'Int16Array' , 'Uint32Array' , 'Int32Array' ,
2229
+ 'Float32Array' , 'Float64Array' , 'Uint8ClampedArray' ,
2230
+ 'BigUint64Array' , 'BigInt64Array' , 'DataView' ,
2231
+ 'Map' , 'BigInt' , 'Set' ,
2232
+ 'WeakMap' , 'WeakSet' , 'Proxy' ,
2233
+ 'Reflect' , 'decodeURI' , 'decodeURIComponent' ,
2234
+ 'encodeURI' , 'encodeURIComponent' , 'escape' ,
2235
+ 'unescape' , 'eval' , 'isFinite' ,
2236
+ 'isNaN' , 'SharedArrayBuffer' , 'Atomics' ,
2237
+ 'globalThis' , 'WebAssembly' , 'global' ,
2238
+ 'process' , 'GLOBAL' , 'root' ,
2239
+ 'Buffer' , 'URL' , 'URLSearchParams' ,
2240
+ 'TextEncoder' , 'TextDecoder' , 'clearInterval' ,
2241
+ 'clearTimeout' , 'setInterval' , 'setTimeout' ,
2242
+ 'queueMicrotask' , 'clearImmediate' , 'setImmediate' ,
2243
+ 'module' , 'require' , 'assert' ,
2244
+ 'async_hooks' , 'buffer' , 'child_process' ,
2245
+ 'cluster' , 'crypto' , 'dgram' ,
2246
+ 'dns' , 'domain' , 'events' ,
2247
+ 'fs' , 'http' , 'http2' ,
2248
+ 'https' , 'inspector' , 'net' ,
2249
+ 'os' , 'path' , 'perf_hooks' ,
2250
+ 'punycode' , 'querystring' , 'readline' ,
2251
+ 'repl' , 'stream' , 'string_decoder' ,
2252
+ 'tls' , 'trace_events' , 'tty' ,
2253
+ 'url' , 'v8' , 'vm' ,
2254
+ 'worker_threads' , 'zlib' , '_' ,
2255
+ '_error' , 'util'
2256
+ ] ;
2257
+
2258
+ out = util . inspect (
2259
+ obj ,
2260
+ { compact : 3 , breakLength : 80 , maxArrayLength : 250 }
2261
+ ) ;
2262
+ expected = [
2263
+ '[' ,
2264
+ " 'Object', 'Function', 'Array'," ,
2265
+ " 'Number', 'parseFloat', 'parseInt'," ,
2266
+ " 'Infinity', 'NaN', 'undefined'," ,
2267
+ " 'Boolean', 'String', 'Symbol'," ,
2268
+ " 'Date', 'Promise', 'RegExp'," ,
2269
+ " 'Error', 'EvalError', 'RangeError'," ,
2270
+ " 'ReferenceError', 'SyntaxError', 'TypeError'," ,
2271
+ " 'URIError', 'JSON', 'Math'," ,
2272
+ " 'console', 'Intl', 'ArrayBuffer'," ,
2273
+ " 'Uint8Array', 'Int8Array', 'Uint16Array'," ,
2274
+ " 'Int16Array', 'Uint32Array', 'Int32Array'," ,
2275
+ " 'Float32Array', 'Float64Array', 'Uint8ClampedArray'," ,
2276
+ " 'BigUint64Array', 'BigInt64Array', 'DataView'," ,
2277
+ " 'Map', 'BigInt', 'Set'," ,
2278
+ " 'WeakMap', 'WeakSet', 'Proxy'," ,
2279
+ " 'Reflect', 'decodeURI', 'decodeURIComponent'," ,
2280
+ " 'encodeURI', 'encodeURIComponent', 'escape'," ,
2281
+ " 'unescape', 'eval', 'isFinite'," ,
2282
+ " 'isNaN', 'SharedArrayBuffer', 'Atomics'," ,
2283
+ " 'globalThis', 'WebAssembly', 'global'," ,
2284
+ " 'process', 'GLOBAL', 'root'," ,
2285
+ " 'Buffer', 'URL', 'URLSearchParams'," ,
2286
+ " 'TextEncoder', 'TextDecoder', 'clearInterval'," ,
2287
+ " 'clearTimeout', 'setInterval', 'setTimeout'," ,
2288
+ " 'queueMicrotask', 'clearImmediate', 'setImmediate'," ,
2289
+ " 'module', 'require', 'assert'," ,
2290
+ " 'async_hooks', 'buffer', 'child_process'," ,
2291
+ " 'cluster', 'crypto', 'dgram'," ,
2292
+ " 'dns', 'domain', 'events'," ,
2293
+ " 'fs', 'http', 'http2'," ,
2294
+ " 'https', 'inspector', 'net'," ,
2295
+ " 'os', 'path', 'perf_hooks'," ,
2296
+ " 'punycode', 'querystring', 'readline'," ,
2297
+ " 'repl', 'stream', 'string_decoder'," ,
2298
+ " 'tls', 'trace_events', 'tty'," ,
2299
+ " 'url', 'v8', 'vm'," ,
2300
+ " 'worker_threads', 'zlib', '_'," ,
2301
+ " '_error', 'util'" ,
2302
+ ']'
2303
+ ] . join ( '\n' ) ;
2304
+
2305
+ assert . strictEqual ( out , expected ) ;
2216
2306
}
0 commit comments